/* ========================================================
   Muslim Companion (رفيق المسلم) - Dashboard Luxury Style
   Font: Cairo / Tajawal Google Fonts (Arabic RTL Modern)
   Palette: Deep Midnight, Emerald, Royal Gold
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

:root {
    --bg-main: #080E17;
    --bg-card: #0F1926;
    --bg-card-hover: #162436;
    --border-color: #1E2D40;
    --border-gold: #D4AF37;
    --primary-emerald: #10B981;
    --primary-emerald-hover: #059669;
    --accent-gold: #F59E0B;
    --danger-red: #EF4444;
    --text-main: #F1F5F9;
    --text-muted: #94A3B8;
    --sidebar-width: 260px;
}

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

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    display: flex;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo-icon {
    font-size: 28px;
}

.sidebar-header .logo-text {
    font-size: 18px;
    font-weight: 800;
    color: #FFF;
}

.sidebar-header .logo-text span {
    color: var(--border-gold);
    font-size: 13px;
    display: block;
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: var(--bg-card-hover);
    color: var(--text-main);
}

.nav-link.active {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--primary-emerald);
    border-right: 3px solid var(--primary-emerald);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--danger-red);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 8px;
}

.sidebar-footer a:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    margin-right: var(--sidebar-width);
    padding: 30px;
    max-width: calc(100% - var(--sidebar-width));
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.page-title h1 {
    font-size: 24px;
    font-weight: 800;
    color: #FFF;
}

.page-title p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

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

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.4);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: rgba(16, 185, 129, 0.12);
    color: var(--primary-emerald);
}

.stat-icon.gold {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-gold);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.12);
    color: #3B82F6;
}

.stat-icon.purple {
    background: rgba(168, 85, 247, 0.12);
    color: #A855F7;
}

.stat-info .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: #FFF;
}

.stat-info .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Content Cards & Sections */
.content-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 26px;
    margin-bottom: 26px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: #FFF;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modern Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #E2E8F0;
}

.form-control, .form-select, textarea.form-control {
    width: 100%;
    background-color: #071018;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    color: #FFF;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-control:focus, .form-select:focus, textarea.form-control:focus {
    border-color: var(--primary-emerald);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-emerald);
    color: #FFF;
}

.btn-primary:hover {
    background-color: var(--primary-emerald-hover);
}

.btn-gold {
    background-color: var(--border-gold);
    color: #000;
}

.btn-gold:hover {
    background-color: #C5A028;
}

.btn-danger {
    background-color: var(--danger-red);
    color: #FFF;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.custom-table th {
    background-color: #08111C;
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.custom-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    color: #E2E8F0;
}

.custom-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: var(--primary-emerald);
}

.badge-gold {
    background-color: rgba(212, 175, 55, 0.15);
    color: var(--border-gold);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--primary-emerald);
    color: #A7F3D0;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger-red);
    color: #FECACA;
}

/* Preview Box for Islamic Background */
.preview-box {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-top: 16px;
    background-color: #071018;
}

.preview-box img {
    max-width: 260px;
    max-height: 400px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid var(--border-gold);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        min-height: unset;
        border-left: none;
        border-bottom: 1px solid var(--border-color);
    }
    body {
        flex-direction: column;
    }
    .main-wrapper {
        margin-right: 0;
        max-width: 100%;
        padding: 20px;
    }
}
