* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    width: 100vw;
    overflow-x: hidden;
}

@media only screen and (max-device-width: 480px) {
    html {
        -webkit-text-size-adjust: none;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #567E98 0%, #4a6b82 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.container {
    width: 100%;
    margin: 0 auto;
    background: white;
}

/* Desktop styles */
@media (min-width: 769px) {
    body {
        padding: 20px;
    }
    
    .container {
        max-width: 1200px;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    }
}

header {
    background: linear-gradient(135deg, #567E98 0%, #4a6b82 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

main {
    padding: 40px 30px;
}

.intro {
    margin-bottom: 40px;
    text-align: center;
}

.intro h2 {
    color: #567E98;
    margin-bottom: 15px;
}

.intro p {
    color: #666;
    font-size: 1.1rem;
}

.chapter-nav {
    margin-bottom: 30px;
}

.nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.chapter-button {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    color: #567E98;
}

.chapter-button:hover {
    background: #567E98;
    color: white;
    border-color: #567E98;
    transform: translateY(-2px);
}

.chapter-button.active {
    background: #567E98;
    color: white;
    border-color: #567E98;
}

.content-viewer {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 40px;
    min-height: 500px;
}

.welcome-message {
    text-align: center;
    padding: 100px 20px;
    color: #666;
}

.welcome-message h3 {
    color: #567E98;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.chapter-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chapter-content h2 {
    color: #567E98;
    margin-bottom: 30px;
    font-size: 2rem;
    border-bottom: 3px solid #BEAB7B;
    padding-bottom: 15px;
}

.chapter-content h3 {
    color: #BEAB7B;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.chapter-content h4 {
    color: #567E98;
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.chapter-content p {
    line-height: 1.8;
    margin-bottom: 15px;
    color: #444;
}

.chapter-content ul,
.chapter-content ol {
    margin-left: 25px;
    margin-bottom: 20px;
}

.chapter-content li {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #444;
}

.chapter-content a {
    color: #567E98;
    text-decoration: none;
    font-weight: 600;
}

.chapter-content a:hover {
    text-decoration: underline;
}

.section-block {
    background: white;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #BEAB7B;
}

footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    header {
        padding: 30px 20px;
    }

    main {
        padding: 30px 20px;
    }

    .content-viewer {
        padding: 25px 20px;
    }

    .section-block {
        padding: 20px;
    }

    .chapter-button {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .chapter-content ol,
    .chapter-content ul {
        margin-left: 20px;
        padding-left: 0;
    }

    .chapter-content li {
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .container {
        border-radius: 0;
        box-shadow: none;
        width: 100%;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    header {
        padding: 25px 15px;
        border-radius: 0;
    }

    main {
        padding: 15px 10px;
    }

    .intro {
        margin-bottom: 25px;
    }

    .intro h2 {
        font-size: 1.3rem;
    }

    .intro p {
        font-size: 0.95rem;
    }

    .content-viewer {
        padding: 15px;
        min-height: 300px;
    }

    .section-block {
        padding: 15px;
        margin-bottom: 15px;
    }

    .chapter-content h2 {
        font-size: 1.4rem;
        margin-bottom: 20px;
    }

    .chapter-content h3 {
        font-size: 1.2rem;
        margin-top: 20px;
    }

    .chapter-content h4 {
        font-size: 1.1rem;
    }

    .chapter-content p {
        font-size: 16px;
        line-height: 1.7;
    }

    .chapter-content ol,
    .chapter-content ul {
        margin-left: 15px;
        padding-left: 0;
    }

    .chapter-content li {
        font-size: 16px;
        margin-bottom: 15px;
        line-height: 1.7;
    }

    .nav-buttons {
        gap: 6px;
    }

    .chapter-button {
        padding: 10px 14px;
        font-size: 16px;
        flex: 1 1 calc(33.333% - 6px);
        min-width: 80px;
    }

    .welcome-message {
        padding: 60px 15px;
    }

    .welcome-message h3 {
        font-size: 1.3rem;
    }

    /* Make Spotify embeds responsive */
    .chapter-content iframe {
        max-width: 100%;
        width: 100% !important;
    }

    /* Prevent buttons and content from overflowing */
    .chapter-content a {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
        display: inline-block;
    }


    .section-block {
        overflow-x: hidden;
    }

    .content-viewer {
        overflow-x: hidden;
    }
}
