:root {
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.15);
    --secondary: #7c3aed;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #d97706;
    --border-color: #e2e8f0;
    
    --bg-header: rgba(248, 250, 252, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.7);
    --bg-glass-hover: rgba(255, 255, 255, 0.85);
    --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.05);
    --shadow-card-hover: 0 10px 30px rgba(15, 23, 42, 0.08);
    
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-4 { margin-top: 2rem; }

.d-flex { display: flex; }
.flex-col { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

/* Header */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, var(--text-main), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--text-main);
}

.mobile-drawer-actions {
    display: none;
}

/* Glass Card */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
}

.glass-card:hover {
    background: var(--bg-glass-hover);
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-card-hover);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Layout for Dashboard */
.portal-layout {
    display: flex;
    min-height: 100vh;
}

.portal-sidebar {
    width: 280px;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
}

.portal-main {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
}

.portal-header {
    height: 70px;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.portal-content {
    padding: 2rem;
    flex: 1;
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.875rem;
    font-weight: 600;
}

.badge-green { background: rgba(16, 185, 129, 0.1); color: var(--accent-green); }
.badge-red { background: rgba(239, 68, 68, 0.1); color: var(--accent-red); }
.badge-blue { background: rgba(59, 130, 246, 0.1); color: var(--primary); }
.badge-yellow { background: rgba(245, 158, 11, 0.1); color: var(--accent-yellow); }

/* ==========================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================== */

/* 1. Global / Tablet View (max-width: 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    .hero h1 {
        font-size: 3rem;
    }
    .portal-sidebar {
        width: 260px;
    }
    .portal-main {
        margin-left: 260px;
    }
}

/* 2. Portal & Layout Adjustments (max-width: 992px) */
@media (max-width: 992px) {
    .portal-sidebar {
        left: -280px;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        box-shadow: 5px 0 25px rgba(15, 23, 42, 0.15);
    }
    .portal-sidebar.active {
        left: 0;
    }
    .portal-main {
        margin-left: 0 !important;
        width: 100%;
    }
    .sidebar-toggle-btn {
        display: inline-flex !important;
    }
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
        gap: 1rem;
    }
    .portal-content {
        padding: 1.5rem;
    }
}

/* 3. Mobile View (max-width: 768px) */
@media (max-width: 1024px) {
    /* Main Landing Page Header Hamburger */
    .mobile-nav-toggle {
        display: inline-flex !important;
    }
    .main-header {
        z-index: 10000 !important;
    }
    .nav-links {
        display: flex !important;
        flex-direction: column;
        flex-wrap: nowrap !important;
        position: fixed;
        top: 0;
        right: -280px;
        width: 280px;
        height: 100vh;
        background: var(--bg-surface);
        padding: 6rem 2rem 2rem;
        gap: 1.25rem !important;
        box-shadow: -5px 0 25px rgba(15, 23, 42, 0.15);
        z-index: 9999;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    .nav-links.active {
        right: 0;
    }
    .nav-links > a {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-main);
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-color);
        width: 100%;
        text-align: left;
        transition: var(--transition);
    }
    .nav-links > a:hover {
        color: var(--primary);
        padding-left: 0.5rem;
    }
    .mobile-drawer-actions {
        display: flex !important;
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 1px solid var(--border-color);
    }
    .nav-actions {
        display: none !important;
    }

    
    /* Typography & Sections */
    .hero {
        padding: 8rem 0 4rem;
    }
    .hero h1,
    .about-hero h1,
    .clients-hero h1,
    .register-hero h1,
    .policy-hero h1,
    .agreement-hero h1 {
        font-size: 2.0rem !important;
        line-height: 1.25 !important;
    }
    .hero p,
    .about-hero p,
    .clients-hero p,
    .register-hero p,
    .policy-hero p,
    .agreement-hero p {
        font-size: 1.0rem !important;
        margin-bottom: 1.5rem !important;
    }
    h2 {
        font-size: 1.6rem !important;
    }
    
    /* Portal adjustments */
    .portal-header {
        padding: 0 1rem;
    }
    .portal-header h2 {
        font-size: 1rem !important;
    }
    
    /* Tables scrollable */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
    
    /* Form groups */
    .form-group {
        margin-bottom: 1rem;
    }
    
    /* Flex wraps */
    .d-flex {
        flex-wrap: wrap;
    }
    .gap-4 {
        gap: 1rem;
    }
    /* Adjust standalone login/register pages padding on mobile */
    main.d-flex.align-center.justify-center {
        padding-top: 6rem !important;
        padding-bottom: 2rem !important;
    }
}

/* 4. Small Mobile View (max-width: 480px) */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.85rem;
    }
    .portal-content {
        padding: 1rem;
    }
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    .glass-card {
        padding: 1.25rem;
    }
    /* Reduce login modal padding & font size on small screens */
    #secureLoginModal > .glass-card {
        padding: 1.25rem !important;
        margin: 0.5rem !important;
        border-radius: var(--radius-md) !important;
    }
    .nav-logo {
        font-size: 1.2rem !important;
    }
}

/* ==========================================
   WAR ROOM PREMIUM ADDITIONS
   ========================================== */

/* War Room Pulse Animations */
@keyframes alertPulseRed {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.pulse-red {
    animation: alertPulseRed 2s infinite;
    border-color: var(--accent-red) !important;
}

@keyframes alertPulseYellow {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    70% { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
.pulse-yellow {
    animation: alertPulseYellow 2s infinite;
    border-color: var(--accent-yellow) !important;
}

/* Chat bubble Simulation styles */
.chat-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #efeae2;
    border-radius: var(--radius-md);
    max-height: 350px;
    overflow-y: auto;
}
.chat-bubble {
    max-width: 85%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.4;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.chat-sent {
    background: #d9fdd3;
    align-self: flex-end;
    border-top-right-radius: 0;
    color: #0f172a;
}
.chat-received {
    background: #ffffff;
    align-self: flex-start;
    border-top-left-radius: 0;
    color: #0f172a;
}
.chat-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 0.25rem;
}

/* Invoice Table & Payout Ledger */
.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.custom-table th, .custom-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.custom-table th {
    background: var(--bg-surface-hover);
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.custom-table tr:hover td {
    background: var(--bg-surface-hover);
}

/* Progress bar customization */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.1s linear;
}

/* News feed ticker */
.news-feed-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}
.news-card {
    padding: 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    transition: var(--transition);
}
.news-card:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

/* Pricing Grid & Card Components */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.pricing-card {
    position: relative;
}

.pricing-card.popular {
    border-color: var(--primary) !important;
    box-shadow: 0 0 30px rgba(37, 99, 235, 0.08);
}

.pricing-card.popular::before {
    content: 'Most Popular';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.price {
    font-size: 3rem;
    font-weight: 800;
    margin: 1rem 0;
    color: var(--text-main);
}

.price span {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pricing-features {
    margin: 2rem 0;
    list-style: none;
    padding: 0;
}

.pricing-features li {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
}
