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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #8b5cf6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000000;
    height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    height: 100vh;
    overflow: hidden;
}

.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 3rem;
    overflow: hidden;
}

.logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(255, 255, 255, 0.1));
    animation: fadeInDown 0.6s ease-out;
}

section {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    animation: fadeIn 0.5s ease-out;
    z-index: 1;
    overflow: hidden;
}

section.active {
    display: flex;
    z-index: 2;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    margin-bottom: 2rem;
}

.mood-selection {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    position: relative;
    z-index: 1;
    padding: 2rem 1rem;
    overflow: hidden;
}

.mood-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.initial-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    animation: fadeIn 0.6s ease-out;
}

.initial-content.hidden {
    display: none;
}

.back-button {
    position: absolute;
    top: -3.5rem;
    left: 0;
    background: #1a1a1a;
    border: 2px solid #333333;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.back-button:hover {
    border-color: var(--primary-color);
    background: #1a1a1a;
    transform: translateX(-4px);
}

.back-button span {
    font-size: 1.2rem;
    line-height: 1;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    font-size: 1.1rem;
    font-weight: 500;
}

.verse-content {
    animation: fadeInUp 0.6s ease-out;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.verse-content.hidden {
    display: none;
}

.verse-content-wrapper {
    background: #1a1a1a;
    border-radius: var(--radius-lg);
    padding: 2rem;
    padding-bottom: 6rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid #333333;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.verse-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 1rem;
    box-shadow: none;
    border: none;
}

.verse-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999999;
    margin-bottom: 1rem;
}

.verse-reference {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-style: italic;
    font-family: 'Lora', Georgia, serif;
}

.verse-text {
    font-size: 1.15rem;
    line-height: 1.7;
    color: #ffffff;
    font-weight: 400;
    font-family: 'Lora', Georgia, serif;
}

.verse-for-you {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #666666;
    margin-bottom: 1.25rem;
    font-family: 'Inter', sans-serif;
}

.verse-reveal-item {
    opacity: 0;
    animation: fadeInUp 0.5s ease-out forwards;
}

.verse-content-wrapper.reveal .verse-for-you { animation-delay: 0.05s; }
.verse-content-wrapper.reveal .verse-card { animation-delay: 0.2s; }
.verse-content-wrapper.reveal .life-lesson-card { animation-delay: 0.4s; }
.verse-content-wrapper.reveal .action-buttons { animation-delay: 0.6s; }

.life-lesson-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    margin-bottom: 1rem;
    box-shadow: none;
    border: none;
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
}

.lesson-label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.lesson-text {
    font-size: 1rem;
    line-height: 1.6;
    color: #ffffff;
    font-weight: 400;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4), 0 8px 10px -6px rgba(99, 102, 241, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #1a1a1a;
    color: #ffffff;
    border: 2px solid #333333;
}

.btn-secondary:hover {
    background: #222222;
    border-color: #555555;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary:active {
    transform: translateY(0);
}

.error-message {
    text-align: center;
    padding: 3rem 2rem;
    background: #1a1a1a;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: 1px solid #333333;
    max-width: 600px;
    margin: 0 auto;
}

.error-message.hidden {
    display: none;
}

.error-message p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #dc2626;
}

.footer {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid #333333;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #000000;
    z-index: 10;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-message {
    font-size: 1rem;
    color: #ffffff;
    font-weight: 400;
    opacity: 0.9;
}

.footer-separator {
    color: #666666;
    font-size: 1rem;
    opacity: 0.5;
}

.footer-credit {
    font-size: 0.875rem;
    color: #999999;
    font-weight: 300;
    opacity: 0.7;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    body {
        padding: 0;
        height: 100vh;
        height: 100dvh;
    }

    .container {
        height: 100vh;
        height: 100dvh;
    }

    section {
        height: 100vh;
        height: 100dvh;
    }

    .mood-selection {
        height: 100vh;
        height: 100dvh;
    }

    .main-content {
        min-height: 100%;
    }

    .app-title {
        font-size: 2rem;
    }

    .app-subtitle {
        font-size: 1rem;
    }

    .logo {
        max-width: 250px;
    }

    .mood-selector {
        max-width: 100%;
    }

    .back-button {
        top: -3rem;
        left: 0;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .verse-content-wrapper {
        padding: 1.5rem;
        padding-bottom: 9rem;
        max-height: calc(100vh - 6rem);
    }

    .verse-text {
        font-size: 1rem;
    }

    .lesson-text {
        font-size: 0.9rem;
    }

    .footer {
        padding: 0.75rem 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        font-size: 0.85rem;
    }

    .verse-card,
    .life-lesson-card {
        padding: 1.5rem;
    }

    .verse-text {
        font-size: 1.1rem;
    }

    .lesson-text {
        font-size: 1rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo {
        max-width: 250px;
    }

    .mood-selector {
        max-width: 100%;
        padding: 0 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .footer {
        padding: 1.5rem 1rem;
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
        margin-top: 2rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .footer-separator {
        display: none;
    }

    .footer-message {
        font-size: 0.9rem;
    }

    .footer-credit {
        font-size: 0.8rem;
    }
}
