/* ============================================
   GLOBAL STYLES & VARIABLES
   ============================================ */

:root {
    --primary-red: #dc143c;
    --dark-red: #8b0000;
    --bright-red: #ff1744;
    --bg-dark: #0f0f0f;
    --bg-darker: #1a1a1a;
    --bg-card: #2a2a2a;
    --text-light: #e0e0e0;
    --text-muted: #b0b0b0;
    --border-dark: #404040;
    --shadow-red: rgba(220, 20, 60, 0.4);
    --shadow-red-strong: rgba(220, 20, 60, 0.6);
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bright-red);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-red) var(--bg-darker);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

/* ============================================
   BASE & TYPOGRAPHY
   ============================================ */

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: "Poppins", sans-serif;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    color: var(--text-light);
}

a {
    color: var(--primary-red);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

a:hover {
    color: var(--bright-red);
    text-shadow: 0 0 10px var(--shadow-red-strong);
}

a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--primary-red);
    transition: width 0.3s ease;
    box-shadow: 0 0 5px var(--primary-red);
}

a:hover::after {
    width: 100%;
}

/* ============================================
   NAVIGATION
   ============================================ */

nav {
    height: 100px;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-card) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 2px solid var(--primary-red);
    box-shadow: 0 4px 15px var(--shadow-red);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
}

.intrologo {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.intrologo img {
    width: 100%;
    height: 100%;
}

nav a {
    text-decoration: none;
    padding: 10px 20px;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
    border-radius: 8px;
}

nav a:hover {
    color: white;
    background: rgba(220, 20, 60, 0.1);
    text-shadow: 0 0 15px var(--shadow-red-strong);
}

nav a::after {
    display: none;
}

/* ============================================
   DOC CONTAINER
   ============================================ */

.doccontainer {
    width: 85%;
    margin: 0 auto;
    padding-top: 60px;
    padding-bottom: 40px;
}

.doccontainer > h2 {
    color: var(--primary-red);
    font-size: 2.5em;
    text-shadow: 0 0 15px var(--shadow-red);
    margin: 40px 0 20px 0;
}

.doccontainer > p {
    color: var(--text-muted);
    font-size: 1.1em;
    line-height: 1.6;
    margin: 0 0 40px 0;
}

/* ============================================
   RESOURCES SECTION
   ============================================ */

.resources {
    color: var(--text-light);
    width: 100%;
    margin: 60px 0;
}

.resources h2 {
    color: var(--primary-red);
    font-size: 1.8em;
    text-shadow: 0 0 15px var(--shadow-red);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resources p {
    font-size: 1em;
    font-weight: 400;
    color: var(--text-muted);
    margin: 10px 0 20px 0;
}

/* ============================================
   CODE BOXES
   ============================================ */

.docbox {
    background: linear-gradient(135deg, rgba(25, 25, 25, 0.95) 0%, rgba(38, 38, 38, 0.95) 100%);
    border-radius: 10px;
    padding: 18px 20px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    margin: 16px 0;
    overflow: hidden;
}

.docbox pre {
    margin: 0;
    overflow-x: auto;
}

.docbox pre::-webkit-scrollbar {
    height: 4px;
}

.docbox code {
    font-family: "Courier New", Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-light);
    display: block;
    white-space: pre;
}

.docbox span {
    color: var(--primary-red);
    font-weight: 600;
}

/* ============================================
   BUTTONS (Unified Cinematic Style)
   ============================================ */

.button,
.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    height: 45px;
    min-width: 140px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    color: white !important;
    box-shadow: 0 4px 15px var(--shadow-red);
    text-decoration: none;
}

/* Ensure Home and 404 links override default link behavior */
.home-buttons a.home-btn {
    color: white !important;
}

.button:hover,
.home-btn:hover {
    background: linear-gradient(135deg, var(--bright-red) 0%, var(--primary-red) 100%);
    box-shadow: 0 8px 25px var(--shadow-red-strong), 0 0 15px var(--primary-red);
    transform: translateY(-3px) scale(1.03);
    color: white !important;
}

.home-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light) !important;
    border: 1px solid var(--border-dark);
    backdrop-filter: blur(10px);
}

.home-btn-secondary:hover {
    background: rgba(220, 20, 60, 0.1);
    border-color: var(--primary-red);
    color: white !important;
    box-shadow: 0 8px 25px var(--shadow-red), 0 0 15px var(--primary-red);
}

/* ============================================
   OUTPUT TOGGLE
   ============================================ */

.displaybtn {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.45s ease, opacity 0.45s ease;
}

.displaybtn.block {
    max-height: 9999px;
    opacity: 1;
}

/* ============================================
   INFO CALLOUT
   ============================================ */

.infodiv {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 14px;
    margin: 20px 0;
    background: rgba(220, 20, 60, 0.07);
    padding: 14px 18px;
    border-radius: 8px;
}

.infodiv i {
    color: var(--primary-red);
    font-size: 1.2em;
    margin-top: 2px;
    flex-shrink: 0;
}

.info {
    font-size: 14px;
    font-weight: 300;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 2px solid var(--primary-red);
    color: var(--text-muted);
    width: 100%;
    padding: 40px 20px;
    margin-top: 60px;
}

footer p {
    margin: 0;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-heart {
    color: var(--primary-red);
}

footer a {
    font-weight: 500;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media screen and (max-width: 968px) {
    .doccontainer {
        width: 95%;
    }

    nav {
        height: auto;
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 10px;
    }

    nav a {
        padding: 6px 12px;
        font-size: 0.9em;
    }

    .intrologo {
        width: 40px;
        height: 40px;
    }

    .resources h2 {
        font-size: 1.4em;
    }

    .docbox code {
        font-size: 12px;
    }

    .button, .home-btn {
        font-size: 13px;
        min-width: 110px;
        height: 40px;
    }
}

@media screen and (max-width: 600px) {
    .doccontainer {
        width: 98%;
        padding-top: 30px;
    }

    .resources h2 {
        font-size: 1.2em;
    }

    .docbox code {
        font-size: 11px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

@keyframes pulseGlow {
    0% { text-shadow: 0 0 10px var(--shadow-red); }
    50% { text-shadow: 0 0 30px var(--shadow-red-strong), 0 0 50px var(--primary-red); }
    100% { text-shadow: 0 0 10px var(--shadow-red); }
}

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

/* ================= ==========================
   HOME PAGE (Home.html)
   ============================================ */

.hero-section {
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 60px 20px;
    background: radial-gradient(circle at center, rgba(220, 20, 60, 0.1) 0%, transparent 70%);
}

.hero-logo {
    width: 120px;
    height: 120px;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 20px var(--shadow-red-strong));
    animation: floating 4s ease-in-out infinite;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.4rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
    animation: fadeIn 1s ease-out;
}

.home-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeIn 1.2s ease-out;
}

/* ============================================
   ERROR PAGE (404.html)
   ============================================ */

.error-container {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
}

.error-code {
    font-size: 12rem;
    font-weight: 900;
    color: var(--primary-red);
    line-height: 1;
    margin: 0;
    animation: floating 3s ease-in-out infinite, pulseGlow 4s infinite;
    position: relative;
    z-index: 1;
}

.error-message {
    font-size: 2rem;
    color: white;
    margin: 20px 0;
    font-weight: 600;
}

.error-desc {
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 500px;
}
