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

:root {
    --primary-color: #8B0000;
    --secondary-color: #FFD700;
    --dark-bg: #0f0f1a;
    --card-bg: #1a1a2e;
    --sidebar-bg: #12121f;
    --text-light: #ffffff;
    --text-muted: #b0b0b0;
    --accent-green: #00ff88;
    --accent-red: #ff4444;
    --accent-blue: #4a9eff;
    --accent-purple: #9c5cff;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--dark-bg) 0%, #1a1a2e 100%);
}

.login-container {
    background: var(--card-bg);
    padding: 40px;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 4rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    display: block;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.login-header p {
    color: var(--text-muted);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-muted);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    right: 15px;
    color: var(--text-muted);
}

.input-wrapper input,
.input-wrapper select,
.input-wrapper textarea {
    width: 100%;
    padding: 15px 45px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(139, 0, 0, 0.1);
}

.error-message {
    display: none;
    color: var(--accent-red);
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 68, 68, 0.1);
    border-radius: 8px;
}

.error-message.show {
    display: block;
}

.login-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a0000 100%);
    color: var(--text-light);
    font-family: 'Cairo', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(139, 0, 0, 0.4);
}

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

.dashboard.hidden {
    display: none;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
    font-size: 2rem;
    color: var(--secondary-color);
}

.sidebar-header span {
    font-size: 1.3rem;
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.sidebar-footer {
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
}

.nav-item.active {
    background: rgba(139, 0, 0, 0.2);
    color: var(--secondary-color);
    border-right-color: var(--secondary-color);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 260px;
    min-height: 100vh;
}

.top-bar {
    background: var(--card-bg);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
}

.admin-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.admin-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content Sections */
.content-section {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.content-section.active {
    display: block;
}

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

.content-section h2 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.content-section h2 i {
    color: var(--secondary-color);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.visitors {
    background: rgba(74, 158, 255, 0.2);
    color: var(--accent-blue);
}

.stat-icon.today {
    background: rgba(156, 92, 255, 0.2);
    color: var(--accent-purple);
}

.stat-icon.week {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent-green);
}

.stat-icon.month {
    background: rgba(255, 215, 0, 0.2);
    color: var(--secondary-color);
}

.stat-info h3 {
    font-size: 1.8rem;
    margin-bottom: 3px;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.stat-trend {
    margin-right: auto;
    font-size: 0.85rem;
    padding: 5px 10px;
    border-radius: 20px;
}

.stat-trend.up {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent-green);
}

.stat-trend.down {
    background: rgba(255, 68, 68, 0.2);
    color: var(--accent-red);
}

.stat-trend.neutral {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* Charts */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-card h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.chart-card h3 i {
    color: var(--secondary-color);
}

/* Activity Card */
.activity-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.activity-card h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.activity-card h3 i {
    color: var(--secondary-color);
}

.activity-list {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.activity-icon.visit {
    background: rgba(74, 158, 255, 0.2);
    color: var(--accent-blue);
}

.activity-info {
    flex: 1;
}

.activity-info p {
    font-size: 0.95rem;
}

.activity-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Visitors Stats */
.visitors-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.visitor-stat-box {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.visitor-stat-box i {
    font-size: 2rem;
    color: var(--secondary-color);
}

.visitor-stat-box h4 {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.visitor-stat-box span {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Table Card */
.table-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px;
}

.table-card h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.table-card h3 i {
    color: var(--secondary-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th {
    background: rgba(139, 0, 0, 0.2);
    color: var(--secondary-color);
    font-weight: 700;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.data-table .status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.data-table .status.active {
    background: rgba(0, 255, 136, 0.2);
    color: var(--accent-green);
}

/* Buttons */
.btn-primary {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a0000 100%);
    color: var(--text-light);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(139, 0, 0, 0.3);
}

.btn-secondary {
    padding: 12px 25px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: transparent;
    color: var(--text-light);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    background: #dc3545;
    color: var(--text-light);
    font-family: 'Cairo', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-danger:hover {
    background: #c82333;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.settings-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-card h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
}

.settings-card h3 i {
    color: var(--secondary-color);
}

.data-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-right: 0;
    }

    .menu-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .content-section {
        padding: 20px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a00000;
}
