/* Admin Login Page Styles - Sakani Theme */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Tajawal:wght@400;500;700;800&display=swap');

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #f97316;
    --bg-color: #0f172a;
    --bg-surface: #1e293b;
    --glass-bg: rgba(30, 41, 59, 0.75);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --success-bg: rgba(16, 185, 129, 0.15);
    --success-border: rgba(16, 185, 129, 0.4);
    --success-text: #34d399;
    --error-bg: rgba(239, 68, 68, 0.15);
    --error-border: rgba(239, 68, 68, 0.4);
    --error-text: #f87171;
    --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
    text-align: right;
    position: relative;
    overflow-x: hidden;
}

/* Background Animated Gradient Blobs */
.bg-glow-1 {
    position: absolute;
    top: -10%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, rgba(139, 92, 246, 0.05) 70%, transparent 100%);
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}

.bg-glow-2 {
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, rgba(249, 115, 22, 0.05) 70%, transparent 100%);
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}

/* Container */
.login-container {
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

/* Glass Card */
.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), var(--shadow-glow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.brand-name {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #a78bfa 50%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-name .dot {
    color: var(--secondary-color);
    -webkit-text-fill-color: var(--secondary-color);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

/* Alert Notification Box */
.alert-box {
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease-in-out;
}

.alert-box.hidden {
    display: none !important;
}

.alert-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}

.alert-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

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

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

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

.input-icon {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 0.85rem 2.8rem 0.85rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-input::placeholder {
    color: #64748b;
}

.form-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.toggle-password {
    position: absolute;
    left: 0.85rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: var(--text-primary);
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 0.9rem 1.5rem;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 0.75rem;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
    transition: all 0.25s ease;
}

.btn-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}

.spinner.hidden {
    display: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer Link */
.login-footer {
    text-align: center;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--primary-color);
}

/* ========================================== */
/* ADMIN DASHBOARD STYLES                    */
/* ========================================== */

.dashboard-container {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

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

.stat-icon.total { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.stat-icon.active { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.stat-icon.hidden { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.stat-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Toolbar & Filters */
.toolbar-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.7rem 2.5rem 0.7rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 0.6rem;
    color: var(--text-primary);
    outline: none;
    font-size: 0.9rem;
}

.search-box i {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.select-input {
    padding: 0.7rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 0.6rem;
    color: var(--text-primary);
    outline: none;
    font-size: 0.85rem;
    cursor: pointer;
}

.select-input option {
    background: #1e293b;
    color: #f8fafc;
}

.btn-add {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.6rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.25s ease;
}

.btn-add:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* Table Styles */
.table-responsive {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    overflow-x: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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

.data-table th {
    background: rgba(15, 23, 42, 0.8);
    padding: 1.1rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    border-bottom: 1px solid var(--glass-border);
    white-space: nowrap;
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    vertical-align: middle;
}

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

.table-img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--glass-border);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-visible { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-hidden { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-uni { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-male { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.badge-female { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.badge-type { background: rgba(139, 92, 246, 0.15); color: #c084fc; }

/* Table Action Buttons */
.actions-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-action {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-action:hover {
    transform: translateY(-2px);
}

.btn-toggle-hide:hover { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border-color: #f59e0b; }
.btn-edit:hover { background: rgba(59, 130, 246, 0.2); color: #3b82f6; border-color: #3b82f6; }
.btn-delete:hover { background: rgba(239, 68, 68, 0.2); color: #ef4444; border-color: #ef4444; }

/* Modal Overlay & Card */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-card {
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 1.25rem;
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6);
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

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

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: none;
    padding: 0.65rem 1.25rem;
    border-radius: 0.6rem;
    font-weight: 600;
    cursor: pointer;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    padding: 0.9rem 1.25rem;
    border-radius: 0.75rem;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #10b981; }
.toast-warning { background: #f59e0b; }
.toast-danger { background: #ef4444; }
.toast-info { background: #3b82f6; }

/* ==================================================================== */
/* 📱 Responsive Mobile & Tablet Rules for Login & Dashboard Pages      */
/* ==================================================================== */

@media (max-width: 992px) {
    .dashboard-container {
        padding: 0.85rem;
        margin: 0.75rem auto;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1.2rem;
        padding: 1.25rem 1rem;
    }

    .dashboard-header > div:last-child {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
        justify-content: stretch;
    }

    .dashboard-header > div:last-child > * {
        flex: 1 1 calc(50% - 0.5rem);
        justify-content: center;
        text-align: center;
        font-size: 0.82rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
        gap: 0.85rem;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .stat-number {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.78rem;
    }
}

@media (max-width: 768px) {
    .toolbar-card {
        padding: 1rem;
        flex-direction: column;
        gap: 0.85rem;
        align-items: stretch;
    }

    .toolbar-card .search-box {
        width: 100%;
    }

    .filter-group {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
    }

    .filter-group select,
    .filter-group .btn-add {
        width: 100% !important;
        justify-content: center;
    }

    /* Modal Form Mobile Layout */
    .modal-overlay {
        padding: 0.75rem;
        align-items: center !important;
        justify-content: center !important;
    }

    .modal-card {
        width: 96%;
        max-width: 600px;
        max-height: 90vh;
        border-radius: 1.25rem;
        margin: auto !important;
    }

    .modal-header {
        padding: 1rem 1.25rem;
        position: sticky;
        top: 0;
        background: #1e293b;
        z-index: 10;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-grid {
        grid-template-columns: 1fr !important;
        gap: 0.85rem;
    }

    #image-boxes-container {
        grid-template-columns: 1fr !important;
    }

    .modal-footer {
        position: sticky;
        bottom: 0;
        background: #1e293b;
        padding: 0.85rem 1rem;
        flex-direction: column-reverse;
        gap: 0.6rem;
        z-index: 10;
    }

    .modal-footer button {
        width: 100% !important;
        padding: 0.8rem;
    }

    /* Data Table Mobile Responsiveness */
    .table-responsive {
        border-radius: 0.85rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 750px;
    }

    .data-table th, 
    .data-table td {
        padding: 0.75rem 0.65rem;
        font-size: 0.82rem;
    }

    .data-table td .btn-action {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .dashboard-header h1 {
        font-size: 1.15rem !important;
    }

    .dashboard-header p {
        font-size: 0.78rem !important;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }

    .stat-card {
        padding: 0.85rem 0.65rem;
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
    }

    .stat-number {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.72rem;
    }

    .toast {
        left: 0.5rem;
        right: 0.5rem;
        bottom: 0.85rem;
        font-size: 0.8rem;
        padding: 0.65rem 0.85rem;
        flex-direction: row;
        justify-content: space-between;
    }
}

