/**
 * Al-Hadath Frontend Styles
 * Version: 4.0.0
 */

/* ===== CSS Variables ===== */
:root {
    --primary-cyan: #06b6d4;
    --primary-cyan-dark: #0891b2;
    --primary-white: #ffffff;
    --dark-bg: #0a0a0a;
    --darker-bg: #050505;
    --text-light: #f8fafc;
    --text-gray: #94a3b8;
    --success-green: #10b981;
    --warning-yellow: #f59e0b;
    --error-red: #ef4444;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.05);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --border-radius-xl: 30px;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-cyan);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-cyan-dark);
}

/* ===== Selection ===== */
::selection {
    background: var(--primary-cyan);
    color: var(--primary-white);
}

/* ===== Toast Notifications ===== */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: var(--border-radius-md);
    color: var(--primary-white);
    font-size: 0.95rem;
    z-index: 100000;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.toast-notification.success {
    background: linear-gradient(135deg, var(--success-green), #059669);
}

.toast-notification.error {
    background: linear-gradient(135deg, var(--error-red), #dc2626);
}

.toast-notification.info {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-cyan-dark));
}

.toast-notification .toast-close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.toast-notification .toast-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

[dir="rtl"] .toast-notification {
    right: auto;
    left: 30px;
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== Loading Spinner ===== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Buttons Base ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-cyan-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-light);
}

.btn-secondary:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--primary-cyan);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== Cards Base ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    transform: translateY(-5px);
}

/* ===== Forms Base ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    color: var(--text-light);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-cyan);
    background: rgba(6, 182, 212, 0.05);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

/* ===== Alerts ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success-green);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error-red);
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--primary-cyan);
}

/* ===== Modal Base ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: linear-gradient(135deg, var(--dark-bg), #111827);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: var(--border-radius-lg);
    max-width: 600px;
    width: 90%;
    padding: 30px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--primary-cyan);
}

[dir="rtl"] .modal-close {
    right: auto;
    left: 15px;
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-approved {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-green);
}

.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-yellow);
}

.status-rejected {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-red);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .toast-notification {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: calc(100% - 40px);
    }
    
    [dir="rtl"] .toast-notification {
        right: 20px;
        left: 20px;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .btn:hover,
    .card:hover {
        transform: none !important;
    }
}