/**
 * Dima Shop - Admin Settings Styles
 * نسخه: 2.0.0 - طراحی مدرن و حرفه‌ای
 * 
 * ویژگی‌ها:
 * - طراحی Glassmorphism
 * - Gradient های زیبا
 * - انیمیشن‌های ملایم
 * - Dark mode support
 * - ریسپانسیو کامل
 */

/* ═══════════════════════════════════════════════════════════
   متغیرهای CSS (Design Tokens)
   ═══════════════════════════════════════════════════════════ */
:root {
    /* رنگ‌های اصلی */
    --dima-primary: #6366f1;
    --dima-primary-dark: #4f46e5;
    --dima-primary-light: #818cf8;
    --dima-secondary: #a855f7;
    --dima-accent: #ec4899;
    
    /* رنگ‌های معنایی */
    --dima-success: #10b981;
    --dima-warning: #f59e0b;
    --dima-danger: #ef4444;
    --dima-info: #3b82f6;
    
    /* رنگ‌های خنثی */
    --dima-gray-50: #f9fafb;
    --dima-gray-100: #f3f4f6;
    --dima-gray-200: #e5e7eb;
    --dima-gray-300: #d1d5db;
    --dima-gray-400: #9ca3af;
    --dima-gray-500: #6b7280;
    --dima-gray-600: #4b5563;
    --dima-gray-700: #374151;
    --dima-gray-800: #1f2937;
    --dima-gray-900: #111827;
    
    /* گرادیانت‌ها */
    --dima-gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --dima-gradient-secondary: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
    --dima-gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --dima-gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --dima-gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --dima-gradient-info: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    --dima-gradient-dark: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    
    /* سایه‌ها */
    --dima-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --dima-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --dima-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --dima-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --dima-shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.15);
    --dima-shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    
    /* شعاع گوشه‌ها */
    --dima-radius-sm: 6px;
    --dima-radius-md: 10px;
    --dima-radius-lg: 16px;
    --dima-radius-xl: 24px;
    --dima-radius-full: 9999px;
    
    /* انیمیشن‌ها */
    --dima-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --dima-transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --dima-transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --dima-transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ═══════════════════════════════════════════════════════════
   استایل‌های پایه
   ═══════════════════════════════════════════════════════════ */
.dima-settings-page {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 20px;
    font-family: 'Vazir', 'IRANSans', Tahoma, sans-serif;
}

.dima-settings-page h1 {
    font-size: 32px;
    font-weight: 900;
    background: var(--dima-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════
   تب‌ها (Tabs)
   ═══════════════════════════════════════════════════════════ */
.dima-settings-page .nav-tab-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: white;
    padding: 12px;
    border-radius: var(--dima-radius-lg);
    box-shadow: var(--dima-shadow-md);
    margin-bottom: 25px;
    border: 1px solid var(--dima-gray-100);
}

.dima-settings-page .nav-tab {
    padding: 10px 18px;
    background: var(--dima-gray-50);
    border: 2px solid transparent;
    border-radius: var(--dima-radius-md);
    font-weight: 600;
    font-size: 14px;
    color: var(--dima-gray-600);
    text-decoration: none;
    transition: all var(--dima-transition-base);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.dima-settings-page .nav-tab:hover {
    background: var(--dima-gray-100);
    color: var(--dima-primary);
    transform: translateY(-2px);
    box-shadow: var(--dima-shadow-sm);
}

.dima-settings-page .nav-tab.nav-tab-active {
    background: var(--dima-gradient-primary);
    color: white;
    border-color: transparent;
    box-shadow: var(--dima-shadow-md), var(--dima-shadow-glow);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════
   کارت‌های تنظیمات (Settings Cards)
   ═══════════════════════════════════════════════════════════ */
.dima-settings-card {
    background: white;
    border: 1px solid var(--dima-gray-100);
    border-radius: var(--dima-radius-lg);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--dima-shadow-sm);
    transition: all var(--dima-transition-base);
    position: relative;
    overflow: hidden;
}

.dima-settings-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--dima-gradient-primary);
    opacity: 0;
    transition: opacity var(--dima-transition-base);
}

.dima-settings-card:hover {
    box-shadow: var(--dima-shadow-lg);
    transform: translateY(-2px);
}

.dima-settings-card:hover::before {
    opacity: 1;
}

.dima-settings-card h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--dima-gray-800);
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--dima-gray-100);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dima-settings-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--dima-gray-700);
    margin: 30px 0 15px 0;
    padding: 10px 15px;
    background: var(--dima-gray-50);
    border-radius: var(--dima-radius-md);
    border-right: 3px solid var(--dima-primary);
}

/* ═══════════════════════════════════════════════════════════
   فرم‌ها (Forms)
   ═══════════════════════════════════════════════════════════ */
.dima-settings-card .form-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.dima-settings-card .form-table th {
    padding: 15px 20px 15px 0;
    font-weight: 600;
    color: var(--dima-gray-700);
    font-size: 14px;
    text-align: right;
    vertical-align: top;
    width: 220px;
}

.dima-settings-card .form-table td {
    padding: 12px 0;
}

.dima-settings-card .form-table label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: var(--dima-gray-700);
    cursor: pointer;
    transition: color var(--dima-transition-fast);
}

.dima-settings-card .form-table label:hover {
    color: var(--dima-primary);
}

/* Input Fields */
.dima-settings-card input[type="text"],
.dima-settings-card input[type="email"],
.dima-settings-card input[type="url"],
.dima-settings-card input[type="tel"],
.dima-settings-card input[type="number"],
.dima-settings-card input[type="password"],
.dima-settings-card select,
.dima-settings-card textarea {
    width: 100%;
    max-width: 500px;
    padding: 12px 16px;
    border: 2px solid var(--dima-gray-200);
    border-radius: var(--dima-radius-md);
    font-family: inherit;
    font-size: 14px;
    color: var(--dima-gray-800);
    background: white;
    transition: all var(--dima-transition-base);
    outline: none;
}

.dima-settings-card input:focus,
.dima-settings-card select:focus,
.dima-settings-card textarea:focus {
    border-color: var(--dima-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.dima-settings-card input:hover,
.dima-settings-card select:hover,
.dima-settings-card textarea:hover {
    border-color: var(--dima-gray-300);
}

.dima-settings-card textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.6;
}

/* Checkbox */
.dima-settings-card input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid var(--dima-gray-300);
    border-radius: var(--dima-radius-sm);
    cursor: pointer;
    transition: all var(--dima-transition-fast);
    accent-color: var(--dima-primary);
}

.dima-settings-card input[type="checkbox"]:checked {
    background: var(--dima-primary);
    border-color: var(--dima-primary);
}

/* Description */
.dima-settings-card .description {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--dima-gray-500);
    line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   دکمه‌ها (Buttons)
   ═══════════════════════════════════════════════════════════ */
.dima-settings-card .button,
.dima-settings-card .button-primary {
    padding: 10px 20px;
    border: none;
    border-radius: var(--dima-radius-md);
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--dima-transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.dima-settings-card .button-primary {
    background: var(--dima-gradient-primary);
    color: white;
    box-shadow: var(--dima-shadow-sm);
}

.dima-settings-card .button-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--dima-shadow-md), var(--dima-shadow-glow);
    color: white;
}

.dima-settings-card .button-primary:active {
    transform: translateY(0);
}

.dima-settings-card .button {
    background: white;
    color: var(--dima-gray-700);
    border: 2px solid var(--dima-gray-200);
}

.dima-settings-card .button:hover {
    border-color: var(--dima-primary);
    color: var(--dima-primary);
    background: var(--dima-gray-50);
}

.dima-settings-card .button-large {
    padding: 14px 32px;
    font-size: 16px;
}

.dima-settings-card .button-link-delete {
    background: transparent;
    color: var(--dima-danger);
    border: none;
    padding: 8px 12px;
}

.dima-settings-card .button-link-delete:hover {
    background: var(--dima-danger);
    color: white;
    border-radius: var(--dima-radius-md);
}

/* ═══════════════════════════════════════════════════════════
   باکس‌های اطلاعاتی (Info Boxes)
   ═══════════════════════════════════════════════════════════ */
.ai-info-box,
.sms-info-box {
    background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
    border-right: 4px solid var(--dima-primary);
    padding: 20px 25px;
    border-radius: var(--dima-radius-md);
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.ai-info-box::before,
.sms-info-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent);
    pointer-events: none;
}

.ai-info-box p,
.sms-info-box p {
    margin: 0 0 10px 0;
    color: var(--dima-gray-700);
    line-height: 1.7;
    position: relative;
}

.ai-info-box p:last-child,
.sms-info-box p:last-child {
    margin-bottom: 0;
}

.ai-info-box a,
.sms-info-box a {
    color: var(--dima-primary);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color var(--dima-transition-fast);
}

.ai-info-box a:hover,
.sms-info-box a:hover {
    border-bottom-color: var(--dima-primary);
}

/* ═══════════════════════════════════════════════════════════
   وضعیت لایسنس (License Status)
   ═══════════════════════════════════════════════════════════ */
.license-status-box {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    border-radius: var(--dima-radius-lg);
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.license-status-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.2), transparent);
    pointer-events: none;
}

.license-status-box.active {
    background: var(--dima-gradient-success);
    color: white;
    box-shadow: var(--dima-shadow-md);
}

.license-status-box.inactive {
    background: var(--dima-gradient-danger);
    color: white;
    box-shadow: var(--dima-shadow-md);
}

.license-status-box .status-icon {
    font-size: 48px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.license-status-box .status-text {
    flex: 1;
    font-size: 16px;
    line-height: 1.6;
}

.license-status-box .status-text strong {
    display: block;
    font-size: 20px;
    margin-bottom: 5px;
}

/* ═══════════════════════════════════════════════════════════
   باکس تست پیامک (SMS Test Box)
   ═══════════════════════════════════════════════════════════ */
.sms-test-box {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 20px;
    background: var(--dima-gray-50);
    border-radius: var(--dima-radius-md);
    border: 2px dashed var(--dima-gray-200);
    margin-top: 15px;
    flex-wrap: wrap;
}

.sms-test-box input {
    flex: 1;
    min-width: 200px;
}

#sms-test-result {
    width: 100%;
    padding: 12px 16px;
    background: white;
    border-radius: var(--dima-radius-md);
    border: 1px solid var(--dima-gray-200);
    font-size: 14px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   دکمه ذخیره (Save Button)
   ═══════════════════════════════════════════════════════════ */
.dima-save-button {
    background: white;
    padding: 25px;
    border-radius: var(--dima-radius-lg);
    margin-top: 30px;
    box-shadow: var(--dima-shadow-md);
    text-align: center;
    border: 1px solid var(--dima-gray-100);
    position: sticky;
    bottom: 20px;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.dima-save-button .button-primary {
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 700;
    background: var(--dima-gradient-primary);
    border: none;
    border-radius: var(--dima-radius-md);
    color: white;
    cursor: pointer;
    transition: all var(--dima-transition-base);
    box-shadow: var(--dima-shadow-md);
}

.dima-save-button .button-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--dima-shadow-xl), var(--dima-shadow-glow);
}

.dima-save-button .button-primary:active {
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════
   نوتیفیکیشن‌ها (Notices)
   ═══════════════════════════════════════════════════════════ */
.dima-settings-page .notice {
    border: none;
    border-radius: var(--dima-radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--dima-shadow-sm);
    animation: slideInDown 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dima-settings-page .notice-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-right: 4px solid var(--dima-success);
    color: #065f46;
}

.dima-settings-page .notice-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-right: 4px solid var(--dima-danger);
    color: #991b1b;
}

.dima-settings-page .notice-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-right: 4px solid var(--dima-warning);
    color: #92400e;
}

.dima-settings-page .notice-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-right: 4px solid var(--dima-info);
    color: #1e40af;
}

/* ═══════════════════════════════════════════════════════════
   Loading States
   ═══════════════════════════════════════════════════════════ */
.dima-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.dima-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(99, 102, 241, 0.3);
    border-top-color: var(--dima-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════
   Responsive Design
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 782px) {
    .dima-settings-page {
        padding: 0 10px;
    }
    
    .dima-settings-page h1 {
        font-size: 24px;
    }
    
    .dima-settings-page .nav-tab-wrapper {
        padding: 8px;
        gap: 6px;
    }
    
    .dima-settings-page .nav-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .dima-settings-card {
        padding: 20px 15px;
    }
    
    .dima-settings-card h2 {
        font-size: 18px;
    }
    
    .dima-settings-card .form-table th {
        display: block;
        width: 100%;
        padding: 10px 0 5px 0;
    }
    
    .dima-settings-card .form-table td {
        display: block;
        padding: 5px 0 15px 0;
    }
    
    .dima-settings-card input[type="text"],
    .dima-settings-card input[type="email"],
    .dima-settings-card input[type="url"],
    .dima-settings-card input[type="tel"],
    .dima-settings-card input[type="number"],
    .dima-settings-card select,
    .dima-settings-card textarea {
        max-width: 100%;
    }
    
    .sms-test-box {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dima-save-button {
        padding: 15px;
    }
    
    .dima-save-button .button-primary {
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════
   Animations
   ═══════════════════════════════════════════════════════════ */
.dima-settings-card {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dima-settings-page .nav-tab {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════
   Dark Mode Support (اختیاری)
   ═══════════════════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
    .dima-settings-page {
        /* می‌توانید استایل‌های dark mode را اینجا اضافه کنید */
    }
}

/* ═══════════════════════════════════════════════════════════
   Print Styles
   ═══════════════════════════════════════════════════════════ */
@media print {
    .dima-save-button,
    .dima-settings-page .nav-tab-wrapper {
        display: none;
    }
    
    .dima-settings-card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* ═══════════════════════════════════════════════════════════
   Utility Classes
   ═══════════════════════════════════════════════════════════ */
.dima-text-gradient {
    background: var(--dima-gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dima-shadow-hover {
    transition: box-shadow var(--dima-transition-base);
}

.dima-shadow-hover:hover {
    box-shadow: var(--dima-shadow-lg);
}

.dima-transform-hover {
    transition: transform var(--dima-transition-base);
}

.dima-transform-hover:hover {
    transform: translateY(-3px);
}