/* Global Styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background-color: #f8fafc;
    --surface-color: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Tajawal', system-ui, sans-serif !important;
    background-color: var(--background-color);
    color: var(--text-primary);
}

/* Main Layout */
.page {
    position: relative;
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

main {
    flex: 1;
    padding: 1.5rem;
}

/* Sidebar */
.sidebar {
    width: 280px;
    height: 100vh;
    position: sticky;
    top: 0;
    background-color: var(--surface-color);
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    z-index: 1000;
}

.sidebar-nav {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.75rem;
    margin-bottom: 2rem;
}

    .sidebar-brand i {
        font-size: 1.75rem;
    }

.nav-item {
    margin-bottom: 0.5rem;
    width: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

    .nav-link i {
        font-size: 1.25rem;
        min-width: 1.5rem;
        text-align: center;
    }

    .nav-link:hover, .nav-link.active {
        color: var(--primary-color);
        background-color: rgba(37, 99, 235, 0.1);
    }

    .nav-link.text-danger:hover {
        color: var(--danger-color) !important;
        background-color: rgba(239, 68, 68, 0.1);
    }

/* Auth Forms */
.auth-container {
    max-width: 480px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--surface-color);
    border-radius: 0.5rem;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

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

    .auth-header h1 {
        font-size: 1.75rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
    }

    .auth-header p {
        color: var(--text-secondary);
    }

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Custom Bootstrap Overrides */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

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

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

.form-control {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
    }

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* RTL Specific */
.me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

.ms-2 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

/* Validation */
.validation-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.alert {
    border-radius: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .page {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
    }

    .sidebar-nav {
        padding: 1rem;
    }

    .sidebar-brand {
        margin-bottom: 1rem;
    }

    .content {
        padding: 1rem;
    }

    .auth-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .nav-link:hover {
        transform: none;
    }
}

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

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

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

    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-primary);
    }

/* Top Row */
.top-row {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    height: 4rem;
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-right: auto;
    color: var(--text-primary);
    font-weight: 500;
}

    .user-info .bi {
        font-size: 1.5rem;
        color: var(--primary-color);
    }

/* Content */
.content {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Error UI */
#blazor-error-ui {
    background: #fef2f2;
    color: var(--danger-color);
    border: 1px solid #fee2e2;
    bottom: 0;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    display: none;
    left: 0;
    padding: 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    text-align: center;
}

    #blazor-error-ui .reload {
        color: var(--primary-color);
        text-decoration: none;
        margin: 0 0.5rem;
        font-weight: 500;
    }

    #blazor-error-ui .dismiss {
        cursor: pointer;
        border: none;
        background: none;
        color: var(--danger-color);
        font-size: 1.25rem;
        line-height: 1;
        padding: 0.25rem;
    }
