:root {
    --primary-bg: #121212;
    --secondary-bg: #1e1e1e;
    --accent-primary: #2d76cc;
    --accent-secondary: #28a746;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: rgba(255, 255, 255, 0.1);
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --header-height: 80px;
    --border-radius-soft: 12px;
    --border-radius-round: 50px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--primary-bg);
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: var(--header-height); /* Add padding to prevent content from going under fixed header */
}

/* HEADER */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--secondary-bg); /* Remove gradient, use solid */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

/* HEADER SCROLL EFFECT */
header.scrolled {
    background: var(--secondary-bg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* HEADER CONTENT */
.header__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 768px) {
    .header__container {
        padding: 0 4px;
        max-width: 100vw;
        width: 100vw;
        min-width: 0;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    body, html {
        overflow-x: hidden !important;
        width: 100vw;
        max-width: 100vw;
    }
}

/* LOGO & TITLE */
.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none; /* This removes the underline */
    gap: 12px; /* Adds consistent spacing between logo and text */
}

.logo-link img {
    width: 40px;
    height: 40px;
    object-fit: contain; /* Ensures logo maintains aspect ratio */
}

header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: transform var(--transition-speed) ease, color var(--transition-speed);
    margin: 0; /* Remove any default margins */
}

/* Hover effect for the entire logo+text combination */
.logo-link:hover {
    text-decoration: none; /* Ensures no underline appears on hover */
}

.logo-link:hover h1 {
    color: var(--accent-primary);
}

/* SEARCH BAR */
.search-container {
    flex-grow: 2;
    max-width: 650px;
    margin: 0 32px;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--secondary-bg);
    border-radius: var(--border-radius-soft);
    padding: 10px 22px;
    transition: all var(--transition-speed);
    border: 1.5px solid var(--border-color);
}

.search-wrapper:hover,
.search-wrapper:focus-within {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 10px;
    font-size: 1rem;
}

#subject-search {
    width: 100%;
    background-color: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1.08rem;
    padding: 6px 0;
    letter-spacing: 0.01em;
}

#subject-search::placeholder {
    color: var(--text-secondary);
    opacity: 0.95;
}

/* HEADER ACTION BUTTONS */
.header__actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

.submit-button,
.copy-button {
    padding: 10px 26px;
    border-radius: var(--border-radius-round);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    text-decoration: none;
    transition: all var(--transition-speed);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: 0.03em;
    box-shadow: 0 2px 8px rgba(45, 118, 204, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-button {
    background-color: var(--accent-primary);
    color: #fff;
    border: 1.5px solid var(--accent-primary);
}

.submit-button:hover {
    /* Remove green background on hover, keep blue */
    background-color: var(--accent-primary);
    color: #fff;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 18px rgba(45, 118, 204, 0.13);
}

.copy-button {
    background-color: #d43b3b;
    color: #fff;
    border: 1.5px solid #d43b3b;
}

.copy-button:hover {
    background-color: #b71c1c;
    color: #fff;
    border-color: #b71c1c;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 6px 18px rgba(212, 59, 59, 0.13);
}

/* Remove Download Button */
.download-button {
    display: none !important;
}

/* MOBILE MENU */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

/* MOBILE SEARCH TOGGLE */
.mobile-search-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px;
    margin-left: 4px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 1002;
    height: 40px;
    width: 40px;
    min-width: 40px;
    min-height: 40px;
}

/* SVG ICONS */
.search-icon-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 24px;
    width: 24px;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 1024px) {
    .header__actions {
        gap: 10px;
    }

    .submit-button,
    .copy-button {
        padding: 8px 16px;
        font-size: 0.92rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }

    .header__container {
        padding: 0 4px;
        max-width: 100vw;
        width: 100vw;
        min-width: 0;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .logo-link img {
        width: 34px;
        height: 34px;
    }

    .mobile-search-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 40px;
        width: 40px;
        min-width: 40px;
        min-height: 40px;
        margin-left: 0;
        margin-right: 2px;
    }

    .search-icon-svg {
        height: 22px;
        width: 22px;
    }

    .search-container {
        position: static;
        width: 100vw;
        max-width: 100vw;
        margin: 0;
        padding: 6px 4px 6px 4px;
        flex-grow: 1;
    }

    .search-wrapper {
        padding: 7px 7px;
    }

    #subject-search {
        font-size: 1rem;
        padding: 6px 0;
    }

    .submit-button,
    .copy-button {
        padding: 10px 0;
        font-size: 1rem;
        min-width: 120px;
    }

    .header__actions {
        gap: 8px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-search-toggle {
        display: flex;
    }

    .search-container {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100vw;
        max-width: 100vw;
        padding: 10px 8px 10px 8px;
        background-color: var(--secondary-bg);
        border-top: 1px solid var(--border-color);
        z-index: 2001;
    }

    .search-container.active {
        display: block;
    }

    .header__actions {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        flex-direction: column;
        background-color: var(--secondary-bg);
        padding: 20px;
        gap: 16px;
        border-top: 1px solid var(--border-color);
        display: none;
    }

    .header__actions.active {
        display: flex;
    }

    .submit-button,
    .copy-button {
        width: 100%;
        text-align: center;
        padding: 14px;
        font-size: 1.08rem;
    }
}

/* Always show search bar on desktop */
@media (min-width: 769px) {
    .mobile-search-toggle {
        display: none !important;
    }

    .search-container {
        display: block !important;
        position: static;
        width: auto;
        max-width: 650px;
        margin: 0 32px;
        padding: 0;
        background: none;
        border: none;
    }
}

.menu-icon {
    position: relative;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    display: block;
}

.menu-icon::before,
.menu-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    left: 0;
    transition: all 0.3s ease;
}

.menu-icon::before {
    top: -8px;
}

.menu-icon::after {
    top: 8px;
}

.mobile-menu-toggle.active .menu-icon {
    background-color: transparent;
}

.mobile-menu-toggle.active .menu-icon::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-menu-toggle.active .menu-icon::after {
    transform: rotate(-45deg);
    top: 0;
}

