:root {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #cbd5e1;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --highlight: #38bdf8;
    --highlight-glow: rgba(56, 189, 248, 0.4);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body {
    font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    direction: rtl;
}

/* Background gradient animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.15), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.15), transparent 25%);
    animation: pulse 15s infinite alternate;
}

@keyframes pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    padding: 2rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--card-shadow);
}

.logo-container {
    margin-bottom: 1rem;
}

.krg-logo {
    height: 100px;
    width: auto;
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.2));
    transition: transform 0.3s ease;
}

.krg-logo:hover {
    transform: scale(1.05);
}

.glass-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(to left, #38bdf8, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Sections */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
}

.glass-card h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--glass-border);
    padding-bottom: 1rem;
    display: inline-block;
}

.glass-card h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--highlight);
}

/* Grand Total Card */
.grand-total-card {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(168, 85, 247, 0.1));
    border: 2px solid var(--highlight);
}

.grand-total-card h2 {
    border-bottom-color: var(--highlight);
}

.total-number {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(to left, #38bdf8, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    text-align: center;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
    white-space: nowrap;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--highlight);
    font-weight: 700;
}

tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

tr:last-child td {
    border-bottom: none;
}

/* Stat Box */
.stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.03);
}

.stat-box h3 {
    color: var(--highlight);
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
}

.stat-box p {
    color: var(--text-muted);
}

/* Charts */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 300px;
}

/* Footer */
.glass-footer {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
}

.glass-footer a {
    color: var(--highlight);
    text-decoration: none;
    transition: color 0.3s;
}

.glass-footer a:hover {
    color: #fff;
    text-shadow: 0 0 8px var(--highlight-glow);
}

.fb-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-weight: 600;
}

/* Fade in animation */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInAnimation 0.8s forwards;
}

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

/* Responsive */
@media (max-width: 992px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .glass-header h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 1rem;
    }
    .glass-card {
        padding: 1.5rem;
    }
    .glass-card h2 {
        font-size: 1.4rem;
    }
    .total-number {
        font-size: 2rem;
    }
}
