/* DALCART PREMIUM GLASSMORPHISM THEME V4 */
/* "Rich Aesthetics" - Production Grade CSS */

:root {
    /* Color Palette */
    --bg-deep: #050b14;
    --bg-rich: #0a1120;
    --glass-panel: rgba(15, 23, 42, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.12);

    --accent-primary: #3b82f6;
    --accent-glow: #60a5fa;
    --accent-secondary: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Spacing & Layout */
    --header-height: 80px;
    --sidebar-width: 280px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    /* Effects */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
    --backdrop-blur: blur(16px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-deep);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.08) 0%, transparent 25%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    /* Flex Column: Header Top, Content Below */
    display: flex;
    flex-direction: column;
    padding-top: 0;
    /* Handled by flex */
    -webkit-font-smoothing: antialiased;
}

/* -------------------------------------------------------------------------- */
/* HEADER COMPONENT - COMPACT */
/* -------------------------------------------------------------------------- */
.header {
    position: relative;
    /* Part of flex flow */
    height: 60px;
    flex-shrink: 0;
    /* Never shrink */
    background: rgba(5, 11, 20, 0.95);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* ... Branding ... */
.branding {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.branding img {
    height: 42px;
    width: 42px;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tagline {
    font-size: 0.75rem;
    color: var(--accent-glow);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ... Search ... */
/* (Keeping Search & Actions as is, they are inside header) */
.actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-container {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 99px;
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    transition: var(--transition);
    width: 300px;
}

.search-container:focus-within {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    width: 340px;
}

.search-container input {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    flex: 1;
    outline: none;
    margin-right: 0.5rem;
}

.search-container input::placeholder {
    color: var(--text-dim);
}

.search-btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.search-btn-icon:hover {
    color: white;
    transform: scale(1.1);
}

.cta {
    background: var(--accent-gradient);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* -------------------------------------------------------------------------- */
/* LAYOUT CONTAINER (New) */
/* -------------------------------------------------------------------------- */
.layout {
    display: flex;
    flex: 1;
    /* Fill remaining vertical space */
    overflow: hidden;
    /* Contain scrollbars inside */
}

/* -------------------------------------------------------------------------- */
/* SIDEBAR */
/* -------------------------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(10, 17, 32, 0.85);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--glass-border);
    padding: 1rem 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* Static in flex layout */
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
}

.sidebar nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    /* Compact padding */
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
    border: 1px solid transparent;
}

.sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.03);
    color: white;
    transform: translateX(4px);
}

.sidebar nav a.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-glow);
    border-color: rgba(59, 130, 246, 0.2);
    font-weight: 600;
}

/* -------------------------------------------------------------------------- */
/* MAIN CONTENT */
/* -------------------------------------------------------------------------- */
.main {
    flex: 1;
    padding: 1rem;
    /* Compact padding */
    overflow-y: auto;
    /* Internal scroll */
    position: relative;
    scroll-behavior: smooth;
    margin: 0;
    /* Reset margins */
}

/* Hero Section */
.hero {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    animation: rotate 20s linear infinite;
    pointer-events: none;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* -------------------------------------------------------------------------- */
/* GLASS CARDS */
/* -------------------------------------------------------------------------- */
.card-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.card {
    background: var(--glass-panel);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.05) 0%,
            transparent 100%);
    opacity: 0;
    transition: var(--transition);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3), var(--shadow-glow);
}

.card:hover::after {
    opacity: 1;
}

.card h3 {
    font-size: 1.25rem;
    color: white;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card h3::before {
    content: '';
    display: block;
    width: 4px;
    height: 20px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* -------------------------------------------------------------------------- */
/* DYNAMIC CONTENT LISTS */
/* -------------------------------------------------------------------------- */
.news-item,
.download-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.news-item:last-child,
.download-item:last-child {
    border-bottom: none;
}

.news-item:hover,
.download-item:hover {
    background: rgba(255, 255, 255, 0.02);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: var(--radius-sm);
}

.news-date,
.download-meta {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-family: monospace;
}

.news-link,
.download-link {
    color: var(--accent-glow);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.news-link:hover,
.download-link:hover {
    color: white;
    text-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

/* -------------------------------------------------------------------------- */
/* CHAT WIDGET - PREMIUM */
/* -------------------------------------------------------------------------- */
.kimberley-chat-button {
    background: var(--accent-gradient) !important;
    border-radius: 99px !important;
    box-shadow: 0 10px 40px rgba(6, 182, 212, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.kimberley-chat-button:hover {
    transform: scale(1.05) translateY(-5px) !important;
    box-shadow: 0 15px 50px rgba(6, 182, 212, 0.6) !important;
}

.kimberley-chat-window {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
}

.chat-header {
    background: linear-gradient(90deg, #0f172a, #1e293b) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.chat-messages {
    background: transparent !important;
}

.chat-msg.agent {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(5px) !important;
}

.chat-msg.user {
    background: var(--accent-primary) !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
}

/* -------------------------------------------------------------------------- */
/* DOWNLOADS & FILTERS */
/* -------------------------------------------------------------------------- */
select {
    appearance: none;
    background: rgba(10, 17, 32, 0.6);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    width: 100%;
    margin-bottom: 1rem;
}

select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* -------------------------------------------------------------------------- */
/* NEWS TICKER */
/* -------------------------------------------------------------------------- */
.news-ticker {
    background: rgba(10, 17, 32, 0.95);
    border-top: 1px solid var(--accent-primary);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
}

/* -------------------------------------------------------------------------- */
/* RESPONSIVE */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
/* RESPONSIVE & MOBILE OPTIMIZATION */
/* -------------------------------------------------------------------------- */

/* Mobile Menu Toggle (Hidden on Desktop) */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 899;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 900px) {
    :root {
        --header-height: 64px;
        /* More compact header */
        --sidebar-width: 260px;
    }

    /* Global Mobile Fixes */
    img,
    video,
    iframe {
        max-width: 100%;
        height: auto;
    }

    /* Layout Adjustments */
    .main {
        margin-left: 0;
        padding: 1rem;
        margin-top: var(--header-height);
        overflow-x: hidden;
        width: 100%;
    }

    .header {
        padding: 0 1rem;
        justify-content: space-between;
    }

    /* Brand Simplified */
    .branding {
        gap: 0.75rem;
    }

    .branding img {
        height: 32px;
        width: 32px;
    }

    .brand-title {
        font-size: 1.1rem;
    }

    .brand-tagline {
        display: none;
        /* Hide tagline to save space */
    }

    /* Sidebar Mobile Panel */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        top: 0;
        height: 100dvh;
        background: rgba(5, 11, 20, 0.98);
        border-right: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
        padding-top: calc(var(--header-height) + 1rem);
        z-index: 900;
        width: 85%;
        max-width: 300px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Mobile Menu Button Visible */
    .mobile-menu-toggle {
        display: block;
        margin-right: 1rem;
    }

    /* Search & Actions */
    .search-container {
        display: none;
        /* Hide full search */
    }

    .actions {
        gap: 0.5rem;
    }

    .cta {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    /* Cards Stack */
    .card-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .card {
        padding: 1.25rem;
    }

    /* Typography */
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Chat Widget Mobile */
    .kimberley-chat-window {
        width: 100% !important;
        height: 100% !important;
        bottom: 0 !important;
        right: 0 !important;
        border-radius: 0 !important;
        top: 0 !important;
        z-index: 10001 !important;
    }


    /* -------------------------------------------------------------------------- */
    /* NEWS MODAL (Added by Kimberley AI) */
    /* -------------------------------------------------------------------------- */
    .modal-overlay {
        display: none;
        position: fixed;
        z-index: 10000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(8px);
        justify-content: center;
        align-items: center;
        animation: fadeIn 0.3s;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }

    .close-modal {
        color: #fff;
        float: right;
        font-size: 28px;
        font-weight: bold;
        transition: color 0.2s;
    }

    .close-modal:hover,
    .close-modal:focus {
        color: var(--accent-glow);
        text-decoration: none;
        cursor: pointer;
    }

    .article-body {
        line-height: 1.8;
        color: #e2e8f0;
    }

    .article-body h1,
    .article-body h2,
    .article-body h3 {
        margin-top: 1.5em;
        margin-bottom: 0.5em;
        color: #fff;
    }

    .article-body p {
        margin-bottom: 1em;
    }

    .article-body ul {
        margin-bottom: 1em;
        padding-left: 1.5em;
    }

    .article-body a {
        color: var(--accent-glow);
        text-decoration: none;
    }