/**
 * ========================================
 * Settings Modal - نافذة الإعدادات
 * ========================================
 * 
 * تصميم عصري لنافذة الإعدادات مع glass morphism
 * 
 * @version 1.0.0
 */

/* Settings Modal Overlay */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100000;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

.settings-modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    opacity: 1;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Settings Modal Content */
.settings-modal-content {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.98) 0%,
        rgba(248, 250, 252, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 10px 30px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.settings-modal.show .settings-modal-content {
    transform: scale(1);
    opacity: 1;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Modal Header */
.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: 20px 20px 0 0;
}

.settings-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-modal-header h2 i {
    color: #3b82f6;
    font-size: 26px;
}

.close-settings {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    font-size: 18px;
    transition: all 0.3s ease;
}

.close-settings:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg) scale(1.1);
}

/* Modal Body */
.settings-modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 180px);
}

.settings-modal-body::-webkit-scrollbar {
    width: 8px;
}

.settings-modal-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.settings-modal-body::-webkit-scrollbar-thumb {
    background: rgba(59, 130, 246, 0.3);
    border-radius: 10px;
}

.settings-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.5);
}

/* Settings Section */
.settings-section {
    margin-bottom: 32px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: #334155;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}

.settings-section h3 i {
    color: #3b82f6;
    font-size: 20px;
}

/* Setting Item */
.setting-item {
    margin-bottom: 20px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

.setting-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    font-size: 15px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: white;
    color: #1e293b;
    transition: all 0.3s ease;
}

.setting-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.setting-input:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.checkbox-label:hover {
    background: rgba(59, 130, 246, 0.05);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.checkbox-label span {
    font-size: 15px;
    font-weight: 500;
    color: #475569;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

/* Modal Footer */
.settings-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 0 0 20px 20px;
}

.footer-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn-primary,
.btn-success,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Cairo', 'Tajawal', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.btn-primary:active,
.btn-success:active,
.btn-secondary:active {
    transform: translateY(0);
}

/* Dark Mode */
body.dark-mode .settings-modal-content {
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.98) 0%,
        rgba(30, 41, 59, 0.95) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .settings-modal-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .settings-modal-header h2 {
    color: #f1f5f9;
}

body.dark-mode .settings-modal-footer {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .settings-section {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .settings-section h3 {
    color: #e2e8f0;
    border-bottom-color: rgba(59, 130, 246, 0.3);
}

body.dark-mode .setting-item label {
    color: #cbd5e1;
}

body.dark-mode .setting-input {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

body.dark-mode .setting-input:focus {
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.9);
}

body.dark-mode .checkbox-label span {
    color: #cbd5e1;
}

body.dark-mode .checkbox-label:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .settings-modal {
        padding: 10px;
    }
    
    .settings-modal-content {
        max-width: 100%;
        border-radius: 16px;
    }
    
    .settings-modal-header,
    .settings-modal-body,
    .settings-modal-footer {
        padding: 16px 20px;
    }
    
    .settings-modal-header h2 {
        font-size: 20px;
    }
    
    .settings-section {
        padding: 16px;
    }
    
    .settings-modal-footer {
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-success,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
