/* Main Style for Social Services V2 - Professional Edition */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;800&display=swap');

:root {
    /* Brand Colors */
    --primary-color: #2563eb;
    /* Royal Blue */
    --primary-dark: #1e40af;
    --primary-light: #60a5fa;
    --secondary-color: #f59e0b;
    /* Amber */
    --accent-color: #06b6d4;
    /* Cyan */
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;

    /* Backgrounds */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(255, 255, 255, 0.5);
    --body-bg: #f3f4f6;
    --sidebar-bg: #ffffff;

    /* Text */
    --text-main: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;

    /* Effects */
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-lg: 1rem;
    --radius-md: 0.75rem;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
    direction: rtl;
    text-align: right;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Glassmorphism Utilities */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.glass-card {
    background: white;
    border: 1px solid rgba(229, 231, 235, 0.5);
    box-shadow: var(--card-shadow);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hover-shadow);
    border-color: var(--primary-light);
}

/* Navbar */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    padding: 0.8rem 0;
}

.navbar-brand {
    font-weight: 800;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 600;
    margin: 0 0.5rem;
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
    background: rgba(37, 99, 235, 0.08);
}

/* Modern Dashboard Cards (Stats) */
.stat-card {
    border: none;
    border-radius: var(--radius-lg);
    background: white;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.stat-card .icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.stat-card.bg-gradient-primary {
    background: linear-gradient(135deg, #4f46e5, #3b82f6);
    color: white;
}

.stat-card.bg-gradient-success {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.stat-card.bg-gradient-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: white;
}

.stat-card.bg-gradient-info {
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    color: white;
}

.stat-card.bg-gradient-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: white;
}

.stat-card.bg-gradient-primary .icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.stat-card.bg-gradient-success .icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.stat-card.bg-gradient-warning .icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.stat-card.bg-gradient-info .icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.stat-card.bg-gradient-danger .icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Buttons */
.btn {
    border-radius: var(--radius-md);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border-color: #e5e7eb;
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
    color: var(--text-main);
}

/* Sidebar for Admin */
.sidebar {
    background: white;
    min-height: calc(100vh - 76px);
    box-shadow: 1px 0 10px rgba(0, 0, 0, 0.03);
    padding: 1.5rem 1rem;
    border-left: 1px solid #f3f4f6;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    font-weight: 600;
    transition: var(--transition);
}

.sidebar-link i {
    width: 24px;
    margin-left: 12px;
    text-align: center;
}

.sidebar-link:hover {
    background-color: #f3f4f6;
    color: var(--primary-color);
    transform: translateX(-4px);
}

.sidebar-link.active {
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-right: 4px solid var(--primary-color);
}

/* Table Design */
.table {
    vertical-align: middle;
}

.table thead th {
    background-color: #f9fafb;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 2px solid #e5e7eb;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    padding: 0.5em 0.8em;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Auth Cards */
.login-container {
    max-width: 480px;
    margin: 5vh auto;
    perspective: 1000px;
}

.login-container .card {
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Utilities */
.text-primary-custom {
    color: var(--primary-color);
}

.shadow-hover:hover {
    box-shadow: var(--hover-shadow) !important;
    transform: translateY(-3px);
}

.rounded-xl {
    border-radius: var(--radius-lg) !important;
}

footer {
    margin-top: auto;
    background: white;
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid #dae1e7;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =========================================
   Mobile Optimization & Responsive Tweaks 
   ========================================= */
@media (max-width: 768px) {

    /* Adjust Hero sections for mobile */
    .hero-section,
    .bg-primary-subtle {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
        text-align: center;
    }

    .hero-section h1,
    .bg-primary-subtle h1,
    .display-5 {
        font-size: 2rem !important;
        line-height: 1.3;
    }

    .hero-section p.lead,
    .bg-primary-subtle p.lead {
        font-size: 1rem !important;
        padding: 0 1rem;
    }

    /* Cards and Grids */
    .card {
        margin-bottom: 1rem;
    }

    .row.g-5 {
        --bs-gutter-y: 1.5rem;
    }

    /* Stat Cards */
    .stat-card {
        margin-bottom: 1rem;
    }

    .stat-card h3 {
        font-size: 1.5rem !important;
    }

    /* Sidebar to Bottom Nav (if used) or adjust width */
    .sidebar {
        min-height: auto;
        padding: 1rem;
        border-left: none;
        border-bottom: 1px solid #f3f4f6;
    }

    /* Tables responsiveness override */
    .table-responsive {
        border: 0;
    }

    /* Navbar brand adjustments */
    .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-brand img {
        height: 35px !important;
        width: 35px !important;
    }

    /* Button adjustments for easier tapping */
    .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }

    .d-flex.justify-content-center.gap-3 {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .d-flex.justify-content-center.gap-3 .btn {
        width: 90%;
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
    }

    /* Modal Image Viewer in service details */
    .modal-xl {
        margin: 0.5rem;
    }
}

@media (max-width: 576px) {

    /* Extreme small screens (Phones portrait) */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    h1,
    h2,
    h3 {
        word-wrap: break-word;
    }
}