/* Mobile-first responsive design for introduction page */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
}

.welcome-message {
    text-align: center;
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
}

.instruction {
    font-style: italic;
    color: #666;
    margin-top: 1rem;
}

.loading-indicator {
    text-align: center;
    padding: 2rem;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile-first: Default styles for small screens */
.introduction-container {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f1e9 0%, #ede0d3 100%);
}

/* Mobile Navigation Header */
.mobile-header {
    display: block;
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #8b5e3c 0%, #7a5235 100%);
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-header h1 {
    color: white;
    font-family: 'Georgia', serif;
    font-size: 1.2em;
    text-align: center;
    margin-bottom: 10px;
}

.mobile-nav-toggle {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-family: 'Georgia', serif;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-nav-toggle .arrow {
    transition: transform 0.3s ease;
}

.mobile-nav-toggle.active .arrow {
    transform: rotate(180deg);
}

/* Mobile Navigation Dropdown */
.mobile-nav-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-nav-dropdown.active {
    max-height: 400px;
    overflow-y: auto;
}

.mobile-nav-dropdown .part-button {
    display: block;
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-bottom: 1px solid #eee;
    background: white;
    text-align: left;
    font-family: 'Georgia', serif;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.mobile-nav-dropdown .part-button:hover {
    background: #f8f1e9;
}

.mobile-nav-dropdown .part-button.active {
    background: #8b5e3c;
    color: white;
}

.mobile-nav-dropdown .part-button:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

/* Desktop sidebar - hidden on mobile */
#partList {
    display: none;
}

/* Content Display */
#contentDisplay {
    padding: 20px 15px;
    background: white;
    margin: 0;
    min-height: calc(100vh - 120px);
}

#contentDisplay h2 {
    font-family: 'Georgia', serif;
    font-size: 1.4em;
    color: #4a2f1a;
    margin-bottom: 20px;
    line-height: 1.3;
    border-left: 4px solid #8b5e3c;
    padding-left: 15px;
}

#contentDisplay p {
    font-size: 1em;
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
    text-align: justify;
}

.welcome-note {
    font-family: 'Georgia', serif;
    font-size: 1.1em;
    color: #8b5e3c;
    text-align: center;
    margin-top: 50px;
    font-style: italic;
}

/* Navigation Buttons */
.navigation-buttons {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-button {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #8b5e3c 0%, #7a5235 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Georgia', serif;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.nav-button:hover {
    background: linear-gradient(135deg, #6b4a2e 0%, #5a3f28 100%);
    transform: translateY(-1px);
}

.nav-button:active {
    transform: translateY(0);
}

/* Loading and Error States */
.content-loading {
    opacity: 0.6;
    pointer-events: none;
}

.error-message {
    text-align: center;
    padding: 50px 20px;
}

.error-message h2 {
    color: #d32f2f;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.retry-button {
    padding: 12px 24px;
    background: #8b5e3c;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    margin-top: 15px;
}

/* Tablet Styles (768px and up) */
@media (min-width: 768px) {
    .mobile-header h1 {
        font-size: 1.4em;
    }
    
    .mobile-nav-toggle {
        font-size: 1.1em;
        padding: 15px;
    }
    
    #contentDisplay {
        padding: 30px 25px;
    }
    
    #contentDisplay h2 {
        font-size: 1.6em;
        margin-bottom: 25px;
    }
    
    #contentDisplay p {
        font-size: 1.1em;
        line-height: 1.7;
    }
    
    .navigation-buttons {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .nav-button {
        width: auto;
        min-width: 150px;
        padding: 12px 20px;
    }
    
    .welcome-note {
        font-size: 1.2em;
    }
}

/* Desktop Styles (1024px and up) */
@media (min-width: 1024px) {
    .introduction-container {
        display: flex;
        min-height: 100vh;
    }
    
    /* Hide mobile header on desktop */
    .mobile-header {
        display: none;
    }
    
    /* Show desktop sidebar */
    #partList {
        display: block;
        width: 350px;
        padding: 30px 20px;
        background: linear-gradient(180deg, #f8f1e9 0%, #f0e6d6 100%);
        border-right: 3px solid #8b5e3c;
        box-shadow: 2px 0 10px rgba(139, 94, 60, 0.1);
        overflow-y: auto;
    }
    
    #partList h2 {
        font-family: 'Georgia', serif;
        font-size: 1.8em;
        color: #4a2f1a;
        margin-bottom: 30px;
        text-align: center;
        text-transform: uppercase;
        letter-spacing: 1px;
        border-bottom: 2px solid #8b5e3c;
        padding-bottom: 15px;
    }
    
    #partList .part-button {
        display: block;
        width: 100%;
        padding: 15px;
        margin: 12px 0;
        background: linear-gradient(135deg, #8b5e3c 0%, #7a5235 100%);
        color: white;
        border: none;
        border-radius: 8px;
        font-family: 'Georgia', serif;
        font-size: 1em;
        cursor: pointer;
        transition: all 0.3s ease;
        text-align: left;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }
    
    #partList .part-button:hover {
        background: linear-gradient(135deg, #6b4a2e 0%, #5a3f28 100%);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }
    
    #partList .part-button.active {
        background: linear-gradient(135deg, #4a2f1a 0%, #3d261a 100%);
        box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    }
    
    /* Desktop content area */
    #contentDisplay {
        flex: 1;
        padding: 40px;
        min-height: 100vh;
    }
    
    #contentDisplay h2 {
        font-size: 2em;
        margin-bottom: 30px;
        padding-left: 20px;
    }
    
    #contentDisplay p {
        font-size: 1.1em;
        line-height: 1.8;
        max-width: 800px;
    }
    
    .welcome-note {
        font-size: 1.4em;
        margin-top: 100px;
    }
}

/* Large Desktop (1440px and up) */
@media (min-width: 1440px) {
    #partList {
        width: 400px;
        padding: 40px 30px;
    }
    
    #partList h2 {
        font-size: 2em;
    }
    
    #partList .part-button {
        font-size: 1.1em;
        padding: 18px;
    }
    
    #contentDisplay {
        padding: 50px 60px;
    }
    
    #contentDisplay h2 {
        font-size: 2.2em;
    }
    
    #contentDisplay p {
        font-size: 1.2em;
        line-height: 1.8;
    }
}

/* Accessibility and Focus States */
.part-button:focus,
.nav-button:focus,
.mobile-nav-toggle:focus {
    outline: 2px solid #4a2f1a;
    outline-offset: 2px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #8b5e3c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6b4a2e;
}

/* Print Styles */
@media print {
    .mobile-header,
    .navigation-buttons,
    #partList {
        display: none !important;
    }
    
    #contentDisplay {
        width: 100% !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
}