/* ===== إعدادات عامة ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --danger-color: #f56565;
    --warning-color: #f59e0b;
    --info-color: #4299e1;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --text-dark: #2d3748;
    --text-gray: #718096;
    --border-color: #e2e8f0;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary-color: #7c3aed;
    --primary-dark: #6d28d9;
    --bg-light: #1a202c;
    --bg-white: #2d3748;
    --text-dark: #e2e8f0;
    --text-gray: #a0aec0;
    --border-color: #4a5568;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    padding: 20px;
    direction: ltr;
    position: relative;
    overflow-x: hidden;
}

/* خلفية متحركة */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: backgroundMove 20s ease-in-out infinite;
}

@keyframes backgroundMove {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 20px); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ===== البطاقات ===== */
.card {
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 40px;
    margin-bottom: 30px;
    animation: slideUp 0.6s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== العناوين ===== */
h1, h2, h3, h4 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-weight: 700;
}

h1 {
    font-size: 32px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient 3s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

h2 {
    font-size: 28px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

h4 {
    font-size: 22px;
    color: var(--text-dark);
}

/* ===== الأزرار ===== */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 101, 101, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #718096 0%, #4a5568 100%);
    color: white;
}

.btn:active {
    transform: scale(0.95);
}

/* ===== حقول الإدخال ===== */
.form-group {
    margin-bottom: 25px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px;
    font-size: 15px;
}

.form-control,
.form-select,
textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    background: var(--bg-light);
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* ===== Checkbox مخصص ===== */
.checkbox-group {
    background: var(--bg-light);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 15px;
    background: var(--bg-white);
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.checkbox-item:hover {
    background: var(--bg-light);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.checkbox-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-right: 15px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-item label {
    font-size: 16px;
    color: var(--text-dark);
    cursor: pointer;
    flex: 1;
    font-weight: 500;
}

/* ===== رفع الصور ===== */
.image-upload {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    background: var(--bg-light);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.image-upload::before {
    content: '📷';
    position: absolute;
    font-size: 60px;
    opacity: 0.1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.image-upload:hover {
    border-color: var(--primary-color);
    background: var(--bg-white);
    transform: scale(1.02);
}

.image-upload input[type="file"] {
    display: none;
}

.image-preview {
    max-width: 300px;
    max-height: 300px;
    margin: 20px auto;
    border-radius: 12px;
    display: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    animation: zoomIn 0.4s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.image-preview.show {
    display: block;
}

/* ===== الروابط ===== */
a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

a:hover::after {
    width: 100%;
}

a:hover {
    color: var(--primary-dark);
}

/* ===== رسائل التنبيه ===== */
.alert {
    padding: 18px 24px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-weight: 500;
    border-left: 5px solid;
    animation: slideInRight 0.4s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, #c6f6d5 0%, #9ae6b4 100%);
    color: #22543d;
    border-left-color: #48bb78;
}

.alert-danger {
    background: linear-gradient(135deg, #fed7d7 0%, #fc8181 100%);
    color: #742a2a;
    border-left-color: #f56565;
}

.alert-info {
    background: linear-gradient(135deg, #bee3f8 0%, #90cdf4 100%);
    color: #1a365d;
    border-left-color: #4299e1;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #78350f;
    border-left-color: #f59e0b;
}

/* ===== Loading Spinner ===== */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 30px auto;
    display: none;
}

.spinner.show {
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== جدول ===== */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
}

th, td {
    padding: 18px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

tr {
    transition: all 0.3s ease;
}

tr:hover {
    background: var(--bg-light);
    transform: scale(1.01);
}

tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.status-pending {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
}

.status-reviewed {
    background: linear-gradient(135deg, #dbeafe, #93c5fd);
    color: #1e40af;
}

.status-resolved {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
}

/* ===== Navbar ===== */
.navbar {
    background: var(--bg-white);
    padding: 20px 35px;
    border-radius: 16px;
    margin-bottom: 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar-brand {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-user span {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 16px;
}

/* ===== Dark Mode Toggle ===== */
.dark-mode-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.dark-mode-toggle:hover {
    transform: scale(1.1) rotate(20deg);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .card {
        padding: 20px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 22px;
    }
    
    table {
        font-size: 14px;
    }
    
    th, td {
        padding: 12px 8px;
    }
    
    .navbar {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .navbar-user {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .dark-mode-toggle {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 24px;
    }
}

/* ===== إخفاء/إظهار ===== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 20px;
}

.mb-3 {
    margin-bottom: 20px;
}

/* ===== تأثيرات إضافية ===== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading-shimmer {
    animation: shimmer 2s infinite;
    background: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-size: 1000px 100%;
}