/* ==============================================================================
   HUB INOVA TECH - PHASE 2
   Global Shared Design System & Core Stylesheet
   ============================================================================== */

/* Design System Token Variables (Light Theme Default) */
:root {
    /* Color Palette - Strong Corporate Blue Theme (Default for Internal Pages) */
    --color-bg: #276fb2;
    --color-bg-alt: #1b5387;
    --color-panel: #ffffff;
    --glass-bg: rgba(39, 111, 178, 0.85); /* Glassmorphic blue */
    
    --color-primary: #276fb2;
    --color-primary-glow: rgba(39, 111, 178, 0.2);
    --color-accent: hsl(38, 100%, 50%); /* Rich gold/amber */
    --color-accent-glow: rgba(255, 162, 0, 0.2);
    
    --color-danger: hsl(354, 75%, 52%);
    --color-success: hsl(142, 70%, 40%);

    /* Typography Hierarchy (Accessible contrast on top of corporate blue) */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-muted: rgba(255, 255, 255, 0.6);
    
    /* Layout Tokens */
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-border-focus: rgba(255, 255, 255, 0.35);
    --glass-shadow: rgba(0, 0, 0, 0.2);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Dark Theme Overrides */
.dark-theme, :root.dark-theme {
    --color-bg: hsl(222, 47%, 7%);
    --color-bg-alt: hsl(222, 47%, 4%);
    --color-panel: rgba(15, 23, 42, 0.45);
    --glass-bg: rgba(15, 23, 42, 0.6);
    
    --color-primary: hsl(210, 100%, 55%);
    --color-primary-glow: hsla(210, 100%, 55%, 0.25);
    --color-accent: hsl(38, 100%, 55%);
    --color-accent-glow: hsla(38, 100%, 55%, 0.2);
    
    --color-danger: hsl(354, 70%, 54%);
    --color-success: hsl(142, 70%, 45%);

    --text-primary: hsl(210, 40%, 98%);
    --text-secondary: hsl(210, 16%, 80%);
    --text-muted: hsl(210, 10%, 60%);
    
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-focus: rgba(255, 255, 255, 0.18);
    --glass-shadow: rgba(0, 0, 0, 0.4);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    background-image: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-alt) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Global Container Rules */
.global-container {
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem;
}

/* ==============================================================================
   STANDARDIZED GLOBAL HEADER (Glassmorphic & Responsive)
   ============================================================================== */
.main-header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999 !important; /* Force header to sit on top of all page elements */
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 30px var(--glass-shadow);
    transition: all 0.2s ease;
    /* Strict animation exclusions to keep header static during page load */
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
}

#global-header {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
    z-index: 9999 !important;
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 3.5rem;
    width: auto;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo-link:hover .logo-img {
    transform: scale(1.03);
}

/* Navigation Menu */
.nav-menu ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-item {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-secondary);
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    color: var(--text-primary);
}

.nav-item:hover::after {
    width: 100%;
}

/* Header Action Buttons */
.nav-btn {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--color-accent);
    padding: 0.6rem 1.4rem;
    border: 1px solid var(--color-accent);
    border-radius: 50px;
    background: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn:hover {
    color: var(--color-bg);
    background-color: var(--color-accent);
    box-shadow: 0 0 15px var(--color-accent-glow);
    transform: translateY(-2px);
}

/* Header Avatar Circle */
.header-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: var(--font-heading);
    border: 1px solid var(--glass-border);
}

/* Mobile Hamburger Trigger */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 110;
}

.mobile-menu-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==============================================================================
   STANDARDIZED GLOBAL FOOTER
   ============================================================================== */
.index-footer {
    width: 100%;
    background: var(--color-bg-alt);
    border-top: 1px solid var(--glass-border);
    padding: 1.5rem;
    text-align: center;
    margin-top: auto;
    z-index: 10;
}

.index-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Page transitions & animations */
.fade-out {
    opacity: 0 !important;
    transform: scale(0.98) !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
}

.page-entry-anim {
    animation: pageEntry 0.2s ease-out forwards;
}

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

/* ==============================================================================
   RESPONSIVE DESIGN (Media Queries)
   ============================================================================== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 320px;
        height: 100vh;
        background: hsl(222, 47%, 6%);
        border-left: 1px solid var(--glass-border);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        padding: 6rem 2rem 2rem;
        transition: right 0.2s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 105;
        display: block;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 2.2rem;
    }

    .nav-item {
        font-size: 1.15rem;
    }

    .nav-btn {
        display: inline-block;
        text-align: center;
        width: 100%;
        margin-top: 1rem;
    }

    /* Hamburger Animation States */
    .mobile-menu-toggle.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }
    .mobile-menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* ==============================================================================
   6. THEME TOGGLE BUTTON & TRANSITION CONTROLS
   ============================================================================== */
.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.15rem;
    padding: 0.5rem;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px var(--glass-shadow);
}

.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glass-border-focus);
    transform: scale(1.08) rotate(15deg);
}

/* Smooth color transitions on theme toggle action */
body, 
.main-header, 
.nav-item, 
.nav-btn, 
.project-card, 
.card, 
.panel, 
.news-card, 
.partner-card, 
.theme-toggle-btn,
input, 
select, 
textarea, 
footer {
    transition: background 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

/* ==============================================================================
   7. CORE CARDS & PANELS COLOR WORKAROUNDS FOR BRAND BLUE CONTRAST
   ============================================================================== */
.project-card, 
.news-card, 
.partner-card, 
.panel, 
.modal-content,
.login-card {
    --text-primary: hsl(222, 47%, 12%);
    --text-secondary: hsl(222, 20%, 35%);
    --text-muted: hsl(222, 10%, 55%);
    --glass-border: rgba(39, 111, 178, 0.12);
    --glass-border-focus: rgba(39, 111, 178, 0.25);
    --glass-shadow: rgba(0, 40, 100, 0.08);
    background-color: #ffffff !important;
}

/* Dark Theme Overrides for Cards on cinematic landing page */
.dark-theme .project-card, 
.dark-theme .news-card, 
.dark-theme .partner-card, 
.dark-theme .panel, 
.dark-theme .modal-content,
.dark-theme .login-card,
:root.dark-theme .project-card, 
:root.dark-theme .news-card, 
:root.dark-theme .partner-card, 
:root.dark-theme .panel, 
:root.dark-theme .modal-content,
:root.dark-theme .login-card {
    --text-primary: hsl(210, 40%, 98%);
    --text-secondary: hsl(210, 16%, 80%);
    --text-muted: hsl(210, 10%, 60%);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-focus: rgba(255, 255, 255, 0.18);
    --glass-shadow: rgba(0, 0, 0, 0.4);
    background-color: rgba(15, 23, 42, 0.45) !important;
}

/* Reusable Elegant Error State Component */
.error-state-card {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3.5rem 2rem;
    background: #1E293B;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    max-width: 500px;
    margin: 2rem auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: pageEntry 0.2s ease-out forwards;
}

.error-state-icon {
    width: 64px;
    height: 64px;
    color: #FF8A00; /* Vibrant Orange accent */
    margin-bottom: 1.5rem;
}

.error-state-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.error-state-text {
    font-size: 0.95rem;
    color: #94A3B8;
    line-height: 1.6;
    margin-bottom: 1.75rem;
    max-width: 380px;
}

.btn-retry {
    background: #FF8A00;
    color: #ffffff;
    border: 1px solid #FF8A00;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.65rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-retry:hover {
    background: #ffffff;
    color: #FF8A00;
    border-color: #FF8A00;
    box-shadow: 0 4px 15px rgba(255, 138, 0, 0.25);
}

