/* =======================================================
   ADYA — Central Stylesheet (styles.css)
   Shared by all pages. Page-specific styles remain in
   each HTML file's <style> block.
   ======================================================= */

/* --- CSS VARIABLES (Dark Academia Foundation) --- */
:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --accent-color: #ffffff;
    --accent-gold: #c9a227;
    --border-color: #333;
    --font-serif: 'Georgia', serif;
    --font-sans: 'Arial', sans-serif;
}

/* --- BASE RESET --- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    max-width: 100vw;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-serif);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

/* --- UNIVERSAL NAVIGATION --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 40px;
    border-bottom: 1px solid #333;
    background-color: #000;
    height: 50px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* --- LOGO --- */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo img {
    height: 28px;
    width: auto;
    border-radius: 5px;
}

.logo span {
    font-weight: bold;
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: #fff;
    font-family: serif;
}

/* --- NAV RIGHT SECTION --- */
.nav-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

/* --- MENU LINKS --- */
.menu {
    display: flex;
    align-items: center;
}

.menu a {
    color: #888;
    text-decoration: none;
    margin-left: 20px;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: 0.3s;
}

.menu a:hover {
    color: #fff;
}

/* --- SEARCH BAR --- */
.search-box {
    position: relative;
    margin-right: 15px;
}

#nav-search-input {
    background: #111;
    border: 1px solid #444;
    color: #e0e0e0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    width: 160px;
    transition: all 0.3s ease;
    outline: none;
    font-family: var(--font-sans);
}

#nav-search-input:focus {
    width: 220px;
    background: #000;
    border-color: #fff;
}

.search-results {
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    display: none;
    z-index: 2000;
}

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

.search-results div {
    padding: 10px;
    font-size: 0.8rem;
    color: #ccc;
    cursor: pointer;
    border-bottom: 1px solid #222;
    font-family: var(--font-sans);
}

.search-results div:hover {
    background: #333;
    color: #fff;
}

/* --- SOCIAL ICONS --- */
.social-icons {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-left: 20px;
    border-left: 1px solid #333;
}

.social-icons a {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1.1rem;
    transition: 0.3s;
}

.social-icons a:hover {
    color: #fff;
    transform: scale(1.2);
}

/* --- USER PROFILE ICON --- */
.profile-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.user-profile {
    width: 35px;
    height: 35px;
    border: 2px solid #C0C0C0;
    border-radius: 50%;
    margin-left: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: all 0.3s ease;
    background: transparent;
}

.user-profile:hover {
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
    border-color: #fff;
}

.user-profile.active {
    background: #333;
    border-color: #fff;
}

.user-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-initials {
    color: #fff;
    font-family: var(--font-sans);
    font-weight: bold;
    font-size: 0.9rem;
    -webkit-user-select: none;
    user-select: none;
}

/* --- PROFILE DROPDOWN MENU --- */
.profile-dropdown {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    width: 160px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    z-index: 2000;
    overflow: hidden;
    animation: fadeIn 0.2s ease;
}

.profile-dropdown.show {
    display: block;
}

.dropdown-item {
    padding: 12px 15px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: #ccc;
    cursor: pointer;
    border-bottom: 1px solid #222;
    transition: background 0.2s;
    display: block;
    text-decoration: none;
    text-align: left;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: #333;
    color: #fff;
}

.dropdown-divider {
    height: 1px;
    background: #333;
}

#auth-action-item {
    font-weight: bold;
    color: #e0e0e0;
}

#auth-action-item:hover {
    background: #2a0a0a;
    color: #ff4081;
}

/* --- HAMBURGER BUTTON (hidden on desktop) --- */
.hamburger {
    display: none;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    margin-left: 15px;
}

/* --- MOBILE MENU OVERLAY --- */
.mobile-menu-overlay {
    display: none;
    flex-direction: column;
    background-color: #0a0a0a;
    width: 100%;
    padding: 20px;
    border-bottom: 1px solid #333;
    position: fixed;
    top: 50px;
    left: 0;
    z-index: 999;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.8);
}

.mobile-menu-overlay.active {
    display: flex;
    animation: slideDown 0.3s ease-out;
}

.mobile-menu-overlay a {
    color: #e0e0e0;
    padding: 15px;
    border-bottom: 1px solid #222;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
}

/* --- AI WIDGET CONTAINER --- */
#ai-widget-container {
    position: relative;
    z-index: 9999;
}

/* --- AI TOGGLE BUTTON (Floating / Pink) --- */
#ai-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: transparent;
    border: 2px solid #E1306C;
    border-radius: 50%;
    font-size: 35px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(225, 48, 108, 0.2);
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Safari fix (red error fix) */
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

#ai-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(225, 48, 108, 0.6);
}

/* --- CHAT WINDOW --- */
#chat-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 320px;
    height: 400px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.hidden {
    display: none !important;
}

.widget-header {
    background: #2c2c2c;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    font-weight: bold;
    border-bottom: 1px solid #333;
}

#close-chat {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}

#chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #1a1a1a;
}

.message {
    max-width: 80%;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.bot-message {
    align-self: flex-start;
    background: #333;
    color: #ddd;
}

.user-message {
    align-self: flex-end;
    background: #fff;
    color: #000;
}

.widget-input-area {
    padding: 10px;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
    background: #1a1a1a;
}

#widget-user-input {
    flex: 1;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #444;
    background: #000;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    outline: none;
}

#widget-send-btn {
    background: #fff;
    color: #000;
    border: none;
    padding: 0 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

#widget-send-btn:hover {
    background: #ccc;
}

/* --- SHARED FOOTER --- */
footer {
    text-align: center;
    padding: 30px;
    background-color: #000;
    border-top: 1px solid #333;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: #666;
    margin-top: auto;
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes navSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
   MOBILE RESPONSIVE (max-width: 768px)
   ===================================================== */
@media (max-width: 768px) {

    /* 1. Hide desktop-only elements */
    .desktop-only {
        display: none !important;
    }

    /* 2. Nav */
    nav {
        padding: 10px 15px;
    }

    .nav-right {
        gap: 10px;
    }

    /* 3. Show & style hamburger */
    .hamburger {
        display: block !important;
        visibility: visible !important;
        color: #ffffff !important;
        font-size: 35px !important;
        min-width: 40px !important;
        height: 40px !important;
        cursor: pointer !important;
        line-height: 40px;
        text-align: center;
        z-index: 9999;
        border: 1px solid #333;
        border-radius: 5px;
        background: rgba(0, 0, 0, 0.5);
        margin-left: 0;
    }

    /* 4. Widget mobile positioning */
    #ai-toggle-btn {
        right: 20px;
        bottom: 20px;
        width: 55px;
        height: 55px;
        font-size: 28px;
    }

    #chat-window {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 90px;
    }
}