/* ========== إعدادات عامة ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #BF7B5E;
    --secondary-color: #374151;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    background: linear-gradient(135deg, #1f2937 0%, #111827 50%, #1f2937 100%);
    min-height: 100vh;
    color: #fff;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem;
}

.container-large {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

/* ========== صفحة تسجيل الدخول ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 2rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.logo-circle {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a8664f 100%);
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 30px rgba(191, 123, 94, 0.4);
    color: #fff;
    transition: transform 0.3s ease;
}

.logo-circle:hover {
    transform: scale(1.1);
}

.logo-circle.small {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
}

.login-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.login-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

/* ========== النماذج ========== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.form-group label svg {
    opacity: 0.7;
}

.required {
    color: #ef4444;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(191, 123, 94, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group select option {
    background: #1f2937;
    color: #fff;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.form-group textarea {
    resize: none;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ========== الأزرار ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #a8664f 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(191, 123, 94, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(191, 123, 94, 0.5);
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
}

/* ========== أزرار التكدس ========== */
.congestion-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 0.75rem;
}

.congestion-btn {
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    border: 2px solid transparent;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.congestion-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.congestion-btn:hover {
    transform: translateY(-2px);
    border-color: currentColor;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.congestion-btn:hover::before {
    opacity: 0.15;
}

.congestion-btn.active {
    border-color: currentColor;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2),
                0 8px 25px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.congestion-btn.active::before {
    opacity: 0.25;
}

/* تدرجات لونية مميزة لكل مستوى */
.congestion-btn[data-level="none"] {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.congestion-btn[data-level="none"]::before {
    background: #10b981;
}

.congestion-btn[data-level="light"] {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.congestion-btn[data-level="light"]::before {
    background: #3b82f6;
}

.congestion-btn[data-level="moderate"] {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.congestion-btn[data-level="moderate"]::before {
    background: #f59e0b;
}

.congestion-btn[data-level="severe"] {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.congestion-btn[data-level="severe"]::before {
    background: #ef4444;
}

/* ========== Header ========== */
.main-header {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-left h1 {
    font-size: 1.25rem;
    margin: 0;
}

.header-left p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

/* ========== Navigation ========== */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-nav {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
}

.mobile-nav.hidden {
    display: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.nav-link.active {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(191, 123, 94, 0.4);
}

.nav-link.logout {
    background: rgba(239, 68, 68, 0.1);
    color: rgba(239, 68, 68, 0.8);
    padding: 0.5rem;
}

.nav-link.logout:hover {
    background: #ef4444;
    color: #fff;
}

.nav-link.logout-mobile {
    background: rgba(239, 68, 68, 0.2);
    color: rgba(255, 100, 100, 1);
}

.nav-link.logout-mobile:hover {
    background: #ef4444;
    color: #fff;
}

/* ========== Main Content ========== */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 100px);
}

/* ========== Report Card ========== */
.report-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 2rem;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.icon-circle {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a8664f 100%);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(191, 123, 94, 0.4);
    color: #fff;
}

.card-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

/* ========== Alerts ========== */
.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ========== Notifications ========== */
.notification {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.5s ease;
}

.success-notification {
    background: #10b981;
    color: #fff;
}

.notification.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -100px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* ========== Reports Page ========== */
.reports-header {
    margin-bottom: 2rem;
}

.reports-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.reports-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

.reports-grid {
    display: grid;
    gap: 1.5rem;
}

.report-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.report-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.report-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.congestion-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.report-header h3 {
    font-size: 1.125rem;
    margin: 0 0 0.25rem 0;
}

.location-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.report-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr) 2fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    padding: 0.875rem;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 0.25rem 0;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: bold;
    margin: 0;
    color: #fff;
}

.stat-congestion .stat-value {
    font-size: 1.125rem;
}

.report-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.detail-section:first-child {
    border-top: none;
    padding-top: 0;
}

.detail-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 0.5rem 0;
}

.detail-text {
    color: #fff;
    line-height: 1.6;
    margin: 0;
}

/* ========== Empty State ========== */
.empty-state {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 2rem;
    padding: 3rem 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.empty-state svg {
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 1.5rem;
}

.empty-state p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
}

/* ========== Footer ========== */
.footer {
    text-align: center;
    margin-top: 2rem;
}

.footer p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.test-credentials {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 1.5rem;
}

.text-small {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0.25rem 0;
}

/* ========== Responsive Design ========== */
@media (max-width: 1024px) {
    .report-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-congestion {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .congestion-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .report-card {
        padding: 1.5rem;
    }
    
    .card-header h2 {
        font-size: 1.25rem;
    }
    
    .report-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-congestion {
        grid-column: span 1;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .congestion-buttons {
        grid-template-columns: 1fr;
    }
    
    .report-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .report-date {
        align-self: flex-start;
    }
}