* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 700px;
    height: 90vh;
    min-height: 600px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Updated Header Layout */
.header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.header-jesus-img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.header-title-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.header h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 300;
    line-height: 1.2;
}

.subtitle {
    color: #7f8c8d;
    font-style: italic;
    font-size: 0.9rem;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.donate-btn {
    background: rgba(255, 221, 87, 0.9);
    border: none;
    border-radius: 50px;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
}

.donate-btn:hover {
    background: rgba(255, 221, 87, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.donate-btn svg {
    fill: #e74c3c;
    transition: transform 0.3s ease;
}

.donate-btn:hover svg {
    transform: scale(1.2);
    animation: heartbeat 1s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.donate-text {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.donate-btn:hover .donate-text {
    opacity: 1;
    max-width: 80px;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50px;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #2c3e50;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.settings-btn svg {
    transition: transform 0.3s ease;
}

.settings-btn:hover svg {
    transform: rotate(90deg);
}

.settings-text {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.settings-btn:hover .settings-text {
    opacity: 1;
    max-width: 80px;
}

/* Chat Container - Fixed to prevent cutoff */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 25px 25px;
    min-height: 0; /* Important for flexbox scrolling */
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
    margin-bottom: 15px;
    min-height: 0; /* Important for flexbox scrolling */
}

.message {
    margin-bottom: 15px;
    padding: 15px 20px;
    border-radius: 18px;
    max-width: 85%;
    line-height: 1.5;
}

.user-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.jesus-message {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    margin-right: auto;
    border-bottom-left-radius: 5px;
}

.chat-input-container {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-shrink: 0; /* Prevent shrinking */
}

#messageInput {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e6ed;
    border-radius: 15px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
    transition: border-color 0.3s ease;
}

#messageInput:focus {
    outline: none;
    border-color: #667eea;
}

#sendButton {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#sendButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    color: #000;
    background: rgba(0, 0, 0, 0.1);
}

.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.modal-description {
    color: #7f8c8d;
    margin-bottom: 25px;
    font-size: 1rem;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section label {
    display: block;
    color: #2c3e50;
    font-weight: 500;
    margin-bottom: 8px;
}

.settings-section select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e6ed;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.settings-section select:focus {
    outline: none;
    border-color: #667eea;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 500;
    color: #2c3e50;
}

.toggle-label input[type="checkbox"] {
    position: relative;
    width: 50px;
    height: 26px;
    appearance: none;
    background: #ddd;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-label input[type="checkbox"]:checked {
    background: #667eea;
}

.toggle-label input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle-label input[type="checkbox"]:checked::before {
    transform: translateX(24px);
}

.setting-description {
    color: #95a5a6;
    font-size: 0.9rem;
    margin-top: 5px;
}

.action-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.representation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.representation-card {
    padding: 20px;
    border: 2px solid #e0e6ed;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.representation-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.representation-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.representation-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.representation-card h3 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.representation-card p {
    color: #7f8c8d;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Mobile Responsiveness - Tablet */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        height: 100vh;
        border-radius: 0;
        max-width: 100%;
    }

    .header {
        padding: 15px 20px;
        flex-wrap: wrap;
    }

    .header-jesus-img {
        width: 50px;
        height: 50px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .header-right {
        gap: 8px;
    }

    .donate-btn, .settings-btn {
        padding: 10px 12px;
    }

    .donate-text, .settings-text {
        display: none;
    }

    .chat-container {
        padding: 15px 20px 20px;
    }

    .chat-messages {
        margin-bottom: 12px;
    }

    .message {
        font-size: 0.95rem;
        padding: 12px 16px;
    }

    #messageInput {
        font-size: 16px; /* Prevents iOS zoom */
        min-height: 55px;
        padding: 12px;
    }

    #sendButton {
        width: 48px;
        height: 48px;
    }

    .modal-content {
        margin: 2% auto;
        padding: 25px;
        width: 95%;
        max-height: 95vh;
    }

    .representation-grid {
        gap: 12px;
    }

    .representation-card {
        padding: 15px;
    }

    .representation-card img {
        width: 60px;
        height: 60px;
    }
}

/* Mobile Responsiveness - Phone */
@media (max-width: 480px) {
    .header {
        padding: 12px 15px;
    }

    .header-left {
        gap: 10px;
    }

    .header-jesus-img {
        width: 45px;
        height: 45px;
        border-width: 2px;
    }

    .header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .header-right {
        gap: 6px;
    }

    .donate-btn, .settings-btn {
        padding: 8px 10px;
        border-radius: 50%;
    }

    .donate-btn svg, .settings-btn svg {
        width: 20px;
        height: 20px;
    }

    .chat-container {
        padding: 12px 15px 15px;
    }

    .chat-messages {
        margin-bottom: 10px;
        padding: 8px 0;
    }

    .message {
        font-size: 0.9rem;
        padding: 10px 14px;
        max-width: 90%;
    }

    .chat-input-container {
        gap: 10px;
    }

    #messageInput {
        font-size: 16px; /* Prevents iOS zoom */
        min-height: 50px;
        padding: 10px;
    }

    #sendButton {
        width: 44px;
        height: 44px;
    }

    .modal-content {
        margin: 1% auto;
        padding: 20px;
        width: 98%;
        max-height: 98vh;
    }

    .modal-content h2 {
        font-size: 1.5rem;
    }

    .representation-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .representation-card {
        padding: 12px;
    }

    .representation-card img {
        width: 50px;
        height: 50px;
    }

    .representation-card h3 {
        font-size: 1rem;
    }

    .representation-card p {
        font-size: 0.85rem;
    }
}

/* Landscape Mode Optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        padding: 10px 15px;
    }

    .header-jesus-img {
        width: 40px;
        height: 40px;
    }

    .header h1 {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.75rem;
    }

    .chat-container {
        padding: 10px 15px 15px;
    }

    .chat-messages {
        margin-bottom: 8px;
    }

    #messageInput {
        min-height: 45px;
    }

    #sendButton {
        width: 42px;
        height: 42px;
    }
}

