@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+Arabic:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #f97316; /* Warm Orange */
    --primary-light: #fdba74; /* Light Orange / Peach */
    --primary-dark: #ea580c; /* Deep Rust Orange */
    --bg-gradient: linear-gradient(135deg, #090d16 0%, #111827 50%, #1e1b4b 100%);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.07);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --input-bg: rgba(9, 13, 22, 0.6);
    --input-border: rgba(255, 255, 255, 0.12);
    --shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
    --radius: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    font-family: 'Noto Sans Arabic', 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background Decorative Blobs */
body::before, body::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.35;
    animation: float 12s infinite alternate;
}

body::before {
    background: var(--primary-color);
    top: -50px;
    right: -50px;
}

body::after {
    background: #6366f1; /* Premium Indigo */
    bottom: -50px;
    left: -50px;
    animation-delay: 2.5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, 20px) scale(1.1); }
}

body[dir="rtl"] {
    text-align: right;
}

/* Top Navigation / Language bar on Login */
.top-bar {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
}

body[dir="rtl"] .top-bar {
    right: auto;
    left: 1.5rem;
}

.btn-lang {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-lang:hover {
    background: var(--primary-color);
    border-color: var(--primary-light);
    color: white;
    box-shadow: 0 0 15px rgba(13, 148, 136, 0.4);
}

.btn-logout {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.75rem;
}

body[dir="rtl"] .btn-logout {
    margin-left: 0;
    margin-right: 0.75rem;
}

.btn-logout:hover {
    background: #ef4444;
    border-color: #f87171;
    color: white;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

/* Centered Container for Login */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    padding: 2rem 1rem;
}

/* Frosted Glass Card */
.card-login {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.card-login:hover {
    box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-light), #4f46e5);
}

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

.login-icon {
    font-size: 3rem;
    display: inline-block;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.login-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

/* Inputs & Forms */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #e2e8f0;
    letter-spacing: 0.5px;
}

.input-container {
    position: relative;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition);
}

body[dir="rtl"] .input-icon {
    left: auto;
    right: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.75rem;
    font-size: 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: white;
    outline: none;
    transition: var(--transition);
}

body[dir="rtl"] .form-control {
    padding: 0.85rem 2.75rem 0.85rem 1rem;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.form-control:focus {
    border-color: var(--primary-light);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.15);
}

.form-control:focus + .input-icon {
    color: var(--primary-light);
}

/* Premium Button */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(13, 148, 136, 0.3);
    margin-top: 2rem;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 148, 136, 0.5);
    background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%);
}

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

/* Error Alert */
.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* General Layout Elements for Portal */
.navbar {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.brand-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: white;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    transition: var(--transition);
}

.brand-title:hover {
    transform: translateY(-1px);
    color: var(--primary-light);
}

.brand-title span:first-child {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.3));
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    flex-grow: 1;
}

.card-dashboard {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(12px);
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    margin-top: 1.5rem;
}

.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.kpi-num {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-light);
    line-height: 1.2;
}

.kpi-lbl {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Glass Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    background: var(--card-bg);
    backdrop-filter: blur(12px);
}

.glass-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

body[dir="rtl"] .glass-table {
    text-align: right;
}

.glass-table th, .glass-table td {
    padding: 1rem 1.25rem;
}

.glass-table th {
    background: rgba(15, 23, 42, 0.5);
    color: var(--primary-light);
    font-weight: 700;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--card-border);
}

.glass-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 0.95rem;
}

.glass-table tr:last-child td {
    border-bottom: none;
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Forms & Modals */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Back button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.btn-back:hover {
    color: white;
    transform: translateX(-3px);
}

body[dir="rtl"] .btn-back:hover {
    transform: translateX(3px);
}
