/* public/assets/css/style.css */

:root {
    --primary-color: #059669;
    --primary-hover: #047857;
    --secondary-color: #10b981;
    --accent-color: #34d399;
    --bg-color: #ecfdf5;
    --text-color: #064e3b;
    --sidebar-bg: #064e3b;
    --sidebar-text: #d1fae5;
    --card-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.5);
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    direction: rtl;
    overflow-x: hidden;
    background-image: radial-gradient(#d1fae5 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    max-width: 80%;
    height: auto;
    display: block;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1.2rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    font-weight: 600;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateX(-5px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nav-link i {
    width: 24px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
}

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    background: var(--card-bg);
    padding: 1.25rem 2rem;
    border-radius: 1rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--glass-border);
}

.top-bar h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.user-info {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Cards & Glassmorphism */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.1);
}

.card h3 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    padding: 2rem;
    border-radius: 1.25rem;
    box-shadow: 0 10px 20px rgba(5, 150, 105, 0.3);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card.secondary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 10px 20px rgba(245, 158, 11, 0.3);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.6rem 1.25rem;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px rgba(5, 150, 105, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(5, 150, 105, 0.3);
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 0.5rem;
}

.btn-lg {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
}

th {
    background-color: rgba(5, 150, 105, 0.1);
    color: var(--primary-color);
    font-weight: 700;
    padding: 1rem;
    text-align: right;
    border-bottom: 2px solid var(--primary-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(243, 244, 246, 0.5);
}

/* Badges */
.badge {
    background-color: #d1fae5;
    color: #065f46;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert.warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 2rem;
    width: 50%;
    border-radius: 1rem;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Hamburger Menu */
.hamburger {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 280px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        overflow-y: auto;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 900;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        padding: 1rem;
        width: 100%;
    }

    .top-bar {
        padding: 1rem;
        flex-direction: row;
        gap: 1rem;
    }

    .top-bar h2 {
        font-size: 1.2rem;
    }

    .hamburger {
        display: block !important;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--primary-color);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 90%;
        margin: 10% auto;
        padding: 1.5rem;
    }

    /* Responsive Tables (Card View) */
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 1rem;
        border: 1px solid #e5e7eb;
        border-radius: 0.75rem;
        background: white;
        padding: 0.5rem;
    }

    td {
        border: none;
        position: relative;
        padding: 0.75rem;
        text-align: left;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        border-bottom: 1px solid #f3f4f6;
        gap: 0.5rem;
    }

    td:last-child {
        border-bottom: none;
        flex-direction: row;
        justify-content: flex-end;
        gap: 1rem;
    }

    td::before {
        content: attr(data-label);
        font-weight: bold;
        color: var(--primary-color);
        text-align: right;
        width: 100%;
        margin-bottom: 0.25rem;
    }
}