:root {
    --dsc-navy: #1A2530;
    --dsc-navy-light: #2A3B4D;
    --dsc-navy-dark: #111827;
    --dsc-gold: #ECA823;
    --mck-yellow: #FACC15;
    --mck-yellow-hover: #EAB308;
    --bg-color: #0B111A;
    --surface: #1A2530;
    --text-main: #FFFFFF;
    --text-muted: #9CA3AF;
    --border: #374151;
    
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    --radius: 16px;
    --shadow: 0 10px 40px rgba(0,0,0,0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    background-image: radial-gradient(circle at top right, rgba(250, 204, 21, 0.03), transparent 600px),
                      radial-gradient(circle at bottom left, rgba(236, 168, 35, 0.03), transparent 600px);
    background-attachment: fixed;
    padding: 20px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 50px;
}

/* Loading Spinner Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 17, 26, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(250, 204, 21, 0.1);
    border-top: 4px solid var(--mck-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header Style */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, var(--dsc-navy-dark), var(--dsc-navy));
    border-radius: var(--radius);
    padding: 30px 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border-bottom: 4px solid var(--mck-yellow);
    position: relative;
}
.header-logo {
    max-height: 80px;
    margin-bottom: 15px;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.header h1 {
    font-size: 2rem;
    color: var(--mck-yellow);
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}
.header p {
    font-size: 1rem;
    color: var(--text-muted);
}
.logout-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}
.logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #FFFFFF;
}
.settings-btn {
    position: absolute;
    top: 20px;
    right: 150px;
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}
.settings-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--mck-yellow);
}
/* Modal Style */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(5px);
    display: flex; justify-content: center; align-items: center;
    z-index: 10000; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 30px; width: 90%; max-width: 500px;
    box-shadow: var(--shadow); position: relative;
}
.modal-close {
    position: absolute; top: 15px; right: 20px; font-size: 1.5rem;
    color: var(--text-muted); cursor: pointer; background: none; border: none;
}
.modal-close:hover { color: #fff; }

/* Card / Section Container */
.card {
    background-color: var(--surface);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Login Layout */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}
.login-card {
    background-color: var(--surface);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
    border: 2px solid var(--dsc-gold);
    text-align: center;
}
.login-card h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--mck-yellow);
}
.input-group {
    margin-bottom: 20px;
    text-align: left;
}
.input-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-muted);
}
.input-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: rgba(0,0,0,0.2);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}
.input-group input:focus {
    outline: none;
    border-color: var(--mck-yellow);
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.2);
}
.btn {
    width: 100%;
    padding: 12px;
    background: var(--mck-yellow);
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn:hover {
    background: var(--mck-yellow-hover);
    transform: translateY(-1px);
}
.error-msg {
    color: #F87171;
    font-size: 0.9rem;
    margin-top: 15px;
    display: none;
}

/* Progress Bar Styles */
.progress-box {
    margin-bottom: 25px;
}
.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 8px;
}
.progress-bar-bg {
    height: 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mck-yellow), var(--dsc-gold));
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.4);
    border-radius: 8px;
    width: 0%;
    transition: width 0.8s ease-in-out;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 30px;
}
@media(min-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.mini-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: var(--transition);
}
.mini-card:hover {
    border-color: rgba(250, 204, 21, 0.3);
}
.mini-card-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.mini-card-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Responsive Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}
th, td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}
th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}
tr:hover td {
    background: rgba(255,255,255,0.01);
}
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: #34D399; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #FBBF24; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #F87171; }
.badge-info { background: rgba(59, 130, 246, 0.15); color: #60A5FA; }

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
    box-shadow: 0 0 8px var(--success);
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Ambassador view styles */
.circle-stat-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}
.circle-stat {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 8px solid rgba(250, 204, 21, 0.1);
    border-top: 8px solid var(--mck-yellow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(250, 204, 21, 0.1);
    margin-bottom: 20px;
}
.circle-val {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--mck-yellow);
    line-height: 1;
}
.circle-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}
.status-pill {
    background: rgba(16, 185, 129, 0.15);
    color: #34D399;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
    text-align: center;
}
.breakdown-card {
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px 10px;
}
.breakdown-day {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}
.breakdown-val {
    font-size: 1.4rem;
    font-weight: 700;
}

.referral-box {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}
.referral-input {
    flex: 1;
    background: rgba(0,0,0,0.3);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-family: monospace;
    font-size: 0.95rem;
    text-align: center;
}
.btn-copy {
    background: var(--dsc-navy-light);
    color: #fff;
    border: 1px solid var(--border);
    padding: 0 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: var(--transition);
}
.btn-copy:hover {
    background: var(--border);
    color: var(--mck-yellow);
}

.quick-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.link-card {
    flex: 1 1 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    transition: var(--transition);
}
.link-card:hover {
    background: rgba(250, 204, 21, 0.05);
    border-color: var(--mck-yellow);
    color: var(--mck-yellow);
    transform: translateY(-2px);
}

/* Alert Box */
.alert-bar {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    padding: 12px 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}
.sync-time {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.nav-links {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}
.nav-link:hover {
    color: var(--mck-yellow);
}

/* Mobile-First Adjustments */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .header {
        padding: 20px 15px;
        position: relative;
    }
    .header-logo {
        max-height: 60px;
    }
    .header h1 {
        font-size: 1.5rem;
    }
    .header p {
        font-size: 0.85rem;
    }
    .logout-btn {
        position: static;
        margin-top: 15px;
        width: 100%;
        text-align: center;
        display: block;
    }
    .settings-btn {
        position: static;
        margin-top: 10px;
        width: 100%;
        text-align: center;
        display: block;
    }
    .card {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    .card-title {
        font-size: 1.15rem;
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        padding-bottom: 15px;
    }
    .stats-grid {
        gap: 15px;
        margin-bottom: 20px;
    }
    .mini-card {
        padding: 15px;
    }
    .mini-card-value {
        font-size: 1.5rem;
    }
    th, td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    .circle-stat {
        width: 140px;
        height: 140px;
    }
    .circle-val {
        font-size: 2rem;
    }
    .referral-box {
        flex-direction: column;
        gap: 8px;
    }
    .btn-copy {
        padding: 12px;
        width: 100%;
    }
    .breakdown-grid {
        gap: 10px;
    }
    .breakdown-card {
        padding: 10px 5px;
    }
    .breakdown-val {
        font-size: 1.1rem;
    }
    .quick-links {
        flex-direction: column;
        gap: 10px;
    }
    .link-card {
        width: 100%;
        padding: 12px;
    }
    .alert-bar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
        padding: 12px 15px;
    }
}

/* Master Portal Navigation Bar */
.portal-navigation {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    background: linear-gradient(135deg, var(--dsc-navy-dark), var(--dsc-navy));
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}
.portal-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    min-height: 44px;
}
.portal-nav-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
}
.portal-nav-btn.active {
    background: var(--mck-yellow);
    color: #000000;
    box-shadow: 0 4px 15px rgba(250, 204, 21, 0.2);
}
.portal-nav-btn.active .nav-icon {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

@media(max-width: 480px) {
    .portal-nav-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
        gap: 4px;
    }
    .portal-navigation {
        gap: 8px;
        padding: 6px;
        margin-bottom: 15px;
    }
}
