:root {
    --primary-color: #1a2a3a;
    /* Deep Navy */
    --accent-color: #c5a059;
    /* Muted Gold */
    --bg-color: #f4f4f4;
    /* Light Grey */
    --text-color: #333;
    --sidebar-width: 280px;
    --font-heading: 'Cinzel', serif;
    --font-body: 'Lato', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    /* Prevent body scroll, handle in content */
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-color);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.logo h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 3rem;
    color: #fff;
    letter-spacing: 2px;
}

.logo span {
    color: var(--accent-color);
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    margin-bottom: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-color);
    padding-left: 10px;
    border-bottom: 1px solid var(--accent-color);
}

.footer {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: auto;
}

/* Main Content */
.content {
    flex-grow: 1;
    position: relative;
    overflow-y: auto;
    scroll-behavior: smooth;
    background: #fff;
}

.section {
    display: none;
    min-height: 100vh;
    padding: 4rem;
    animation: fadeIn 0.5s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Abstract Section */
.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding-top: 5rem;
    text-align: center;
}

.thesis-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.thesis-subtitle {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 3rem;
    font-weight: 300;
}

.abstract-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #555;
    text-align: justify;
    margin-bottom: 3rem;
}

.cta-button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    font-family: var(--font-heading);
    letter-spacing: 1px;
}

.cta-button:hover {
    background: var(--accent-color);
    transform: scale(1.05);
}

/* Flipbook Section */
.flipbook-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #e9e9e9;
    /* Slight contrast for the book bg */
    padding: 2rem;
    user-select: none;
    /* Protection */
}

#book {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.controls {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.controls button {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.controls button:hover {
    background: var(--primary-color);
    color: #fff;
}

.protection-notice {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #777;
}

.protection-notice a {
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
}

/* Media Section */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.media-card {
    background: #f9f9f9;
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: transform 0.3s;
}

.media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.icon-placeholder {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.coming-soon {
    display: inline-block;
    background: #eee;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-top: 1rem;
    color: #888;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 2.5rem;
    border-radius: 4px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
}

.modal h2 {
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    color: var(--primary-color);
}

#request-form input,
#request-form textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-family: var(--font-body);
}

#request-form button {
    width: 100%;
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 1rem;
    cursor: pointer;
    font-weight: bold;
    letter-spacing: 1px;
}


/* Infographic Section */
.infographic-container {
    text-align: center;
    margin-top: 2rem;
    padding-bottom: 2rem;
}

.infographic-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
    max-height: 80vh;
    /* Prevent it from being too tall on large screens */
    object-fit: contain;
}

.download-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s;
    font-family: var(--font-heading);
    border: 1px solid transparent;
}

.download-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Disclaimer Modal Specifics */
.disclaimer-content {
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    border-left: 5px solid var(--accent-color);
}

.disclaimer-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 2rem;
    text-align: justify;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.cancel-button {
    background: transparent;
    border: 1px solid #aaa;
    color: #666;
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    font-family: var(--font-heading);
}

.cancel-button:hover {
    background: #f0f0f0;
    color: #333;
    border-color: #888;
}

#disclaimer-modal {
    z-index: 2000;
    /* Highest priority */
}

/* Sidebar Footer Disclaimer */
.footer .disclaimer-mini {
    font-size: 0.65rem;
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.3);

    line-height: 1.2;
}

/* New Footer Styles */
.footer-notice,
.footer-license {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    line-height: 1.3;
    padding: 0.5rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.footer-notice p,
.footer-license p {
    margin-bottom: 0.3rem;
}

.clickable {
    cursor: pointer;
}

.clickable:hover {
    background: rgba(255, 255, 255, 0.15);
}

.footer-license img {
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Formatted Disclaimer in Abstract */
.disclaimer-format strong {
    color: var(--primary-color);
    font-weight: 700;
}


.disclaimer-format em {
    font-style: italic;
    color: #555;
}

/* Contact Page Styles */
.contact-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    margin-top: 2rem;
}

.contact-info,
.contact-form-wrapper {
    flex: 1;
    min-width: 300px;
}

.contact-info h3,
.contact-form-wrapper h3 {
    font-family: var(--font-heading);
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 0.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-item a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.2s;
}

.contact-item a:hover {
    color: var(--accent-color);
}

.icon,
.icon-social {
    margin-right: 1rem;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: var(--font-body);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 5px rgba(26, 42, 58, 0.2);
}

/* Modal Note */
.modal-note {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1.5rem;
    font-style: italic;
    background: #f9f9f9;
    padding: 0.8rem;
    border-left: 3px solid var(--accent-color);
}

/* Maintenance Modal */
.maintenance-content {
    text-align: center;
}

.maintenance-content input {
    width: 60%;
    margin: 0 auto;
    text-align: center;
    font-size: 1.2rem;
    padding: 0.5rem;
    margin-bottom: 1rem;
}

/* --- Mobile Responsiveness --- */

/* Default: Hide mobile button on desktop */
.mobile-menu-btn {
    display: none;
}

/* ===========================================
   MOBILE RESPONSIVE - Single Block
   =========================================== */
@media (max-width: 768px) {

    /* --- Body & Layout --- */
    body {
        overflow-y: auto;
    }

    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    /* --- Sidebar (Off-canvas Drawer) --- */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        padding: 2rem;
        transition: left 0.3s ease-in-out;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        background-color: var(--primary-color);
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    }

    .sidebar.active {
        left: 0;
    }

    /* Ensure nav-links ARE visible inside sidebar */
    .nav-links {
        display: block !important;
    }

    .logo h1 {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }

    /* Dark overlay behind sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* --- Mobile Menu Button (Hamburger) --- */
    .mobile-menu-btn {
        display: block;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 1100;
        background-color: var(--accent-color);
        color: #fff;
        border: none;
        font-size: 1.6rem;
        padding: 0.4rem 0.7rem;
        cursor: pointer;
        border-radius: 6px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        line-height: 1;
    }

    /* --- Main Content --- */
    .content {
        margin-left: 0;
        width: 100%;
        padding: 0.5rem;
        padding-top: 55px;
    }

    .section {
        padding: 1.5rem 1rem;
        min-height: auto;
    }

    /* --- Typography --- */
    .hero-content {
        padding-top: 1rem;
    }

    .hero-content h2.thesis-title {
        font-size: 1.3rem;
    }

    .thesis-subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .abstract-text {
        font-size: 1rem;
        line-height: 1.6;
    }

    /* --- Disclaimer Modal (Buttons fix) --- */
    .disclaimer-content {
        max-width: 95vw;
        padding: 1.5rem;
        max-height: 85vh;
    }

    .disclaimer-text {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-actions .cta-button,
    .modal-actions .cancel-button {
        width: 100%;
        text-align: center;
        padding: 0.8rem;
    }

    /* --- Modals General --- */
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    /* --- Maintenance Modal --- */
    .maintenance-content input {
        width: 80%;
    }

    #maintenance-modal {
        z-index: 2100;
    }

    /* --- Flipbook (PDF Preview) --- */
    .flipbook-container {
        padding: 0.5rem;
        overflow-x: auto;
        overflow-y: hidden;
    }

    #book {
        margin: 0 auto;
    }

    .controls {
        gap: 0.8rem;
    }

    .controls button {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    /* --- Media Section --- */
    .media-grid {
        grid-template-columns: 1fr;
    }

    .media-card {
        padding: 1rem;
    }

    audio {
        width: 100%;
    }

    /* --- Contact Page --- */
    .contact-container {
        flex-direction: column;
    }

    .contact-info,
    .contact-form-wrapper {
        width: 100%;
        min-width: auto;
    }

    /* --- Download Button --- */
    .download-btn {
        font-size: 0.9rem;
        padding: 10px 16px;
    }

    /* --- Footer in sidebar --- */
    .footer {
        font-size: 0.7rem;
    }

    .footer-license img {
        width: 60px;
    }
}