@import url('https://fonts.googleapis.com/css2?family=Vazir:wght@300;400;500;700&display=swap');

:root {
    --irandargah-primary: #0066CC;
    --irandargah-primary-dark: #0052A3;
    --irandargah-secondary: #0A33FF;
    --irandargah-accent: #FF6B35;
    --irandargah-success: #10B981;
    --irandargah-error: #EF4444;
    --irandargah-warning: #F59E0B;
    
    --irandargah-spacing-xs: 0.25rem;
    --irandargah-spacing-sm: 0.5rem;
    --irandargah-spacing-md: 1rem;
    --irandargah-spacing-lg: 1.5rem;
    --irandargah-spacing-xl: 2rem;
    --irandargah-spacing-2xl: 3rem;
    
    --irandargah-radius-sm: 0.375rem;
    --irandargah-radius-md: 0.5rem;
    --irandargah-radius-lg: 0.75rem;
    --irandargah-radius-xl: 1rem;
    
    --irandargah-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --irandargah-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --irandargah-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --irandargah-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    --irandargah-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --irandargah-bg-primary: #FFFFFF;
    --irandargah-bg-secondary: #F9FAFB;
    --irandargah-bg-tertiary: #F3F4F6;
    --irandargah-text-primary: #111827;
    --irandargah-text-secondary: #6B7280;
    --irandargah-text-tertiary: #9CA3AF;
    --irandargah-border: #E5E7EB;
    --irandargah-card-bg: #FFFFFF;
    --irandargah-card-border: #E5E7EB;
}

[data-theme="dark"] {
    --irandargah-bg-primary: #1F2937;
    --irandargah-bg-secondary: #111827;
    --irandargah-bg-tertiary: #0F172A;
    --irandargah-text-primary: #F9FAFB;
    --irandargah-text-secondary: #D1D5DB;
    --irandargah-text-tertiary: #9CA3AF;
    --irandargah-border: #374151;
    --irandargah-card-bg: #1F2937;
    --irandargah-card-border: #374151;
}

* {
    box-sizing: border-box;
}

.irandargah-dashboard-wrap {
    font-family: 'Vazir', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
    background: var(--irandargah-bg-secondary);
    min-height: 100vh;
    padding: var(--irandargah-spacing-xl);
    color: var(--irandargah-text-primary);
    transition: var(--irandargah-transition);
}

.irandargah-header {
    background: var(--irandargah-card-bg);
    border-radius: var(--irandargah-radius-xl);
    padding: var(--irandargah-spacing-xl);
    margin-bottom: var(--irandargah-spacing-xl);
    box-shadow: var(--irandargah-shadow-md);
    border: 1px solid var(--irandargah-card-border);
}

.irandargah-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--irandargah-spacing-md);
}

.irandargah-title {
    display: flex;
    align-items: center;
    gap: var(--irandargah-spacing-md);
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0;
    color: var(--irandargah-text-primary);
}

.irandargah-title-icon {
    width: 2rem;
    height: 2rem;
    color: var(--irandargah-primary);
}

.irandargah-header-actions {
    display: flex;
    gap: var(--irandargah-spacing-md);
}

.irandargah-theme-toggle {
    background: var(--irandargah-bg-tertiary);
    border: 1px solid var(--irandargah-border);
    border-radius: var(--irandargah-radius-lg);
    padding: var(--irandargah-spacing-sm) var(--irandargah-spacing-md);
    cursor: pointer;
    font-size: 1.25rem;
    transition: var(--irandargah-transition);
    display: flex;
    align-items: center;
    gap: var(--irandargah-spacing-sm);
}

.irandargah-theme-toggle:hover {
    background: var(--irandargah-bg-primary);
    transform: translateY(-2px);
    box-shadow: var(--irandargah-shadow-md);
}

.theme-icon-light,
.theme-icon-dark {
    display: inline-block;
    transition: var(--irandargah-transition);
}

[data-theme="light"] .theme-icon-dark {
    display: none;
}

[data-theme="dark"] .theme-icon-light {
    display: none;
}

.irandargah-notice {
    display: flex;
    align-items: center;
    gap: var(--irandargah-spacing-md);
    padding: var(--irandargah-spacing-md) var(--irandargah-spacing-lg);
    border-radius: var(--irandargah-radius-lg);
    margin-bottom: var(--irandargah-spacing-xl);
    animation: slideDown 0.3s ease-out;
}

.irandargah-notice-success {
    background: #D1FAE5;
    border: 1px solid var(--irandargah-success);
    color: #065F46;
}

[data-theme="dark"] .irandargah-notice-success {
    background: #064E3B;
    color: #D1FAE5;
}

.irandargah-notice-icon {
    font-size: 1.25rem;
    font-weight: bold;
}

.irandargah-gateways-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: var(--irandargah-spacing-xl);
}

.irandargah-gateway-card {
    background: var(--irandargah-card-bg);
    border: 1px solid var(--irandargah-card-border);
    border-radius: var(--irandargah-radius-xl);
    padding: var(--irandargah-spacing-xl);
    box-shadow: var(--irandargah-shadow-md);
    transition: var(--irandargah-transition);
    overflow: hidden;
}

.irandargah-gateway-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--irandargah-shadow-xl);
}

.irandargah-gateway-card-header {
    display: flex;
    align-items: flex-start;
    gap: var(--irandargah-spacing-lg);
    margin-bottom: var(--irandargah-spacing-lg);
}

.irandargah-gateway-icon {
    flex-shrink: 0;
}

.irandargah-gateway-info {
    flex: 1;
}

.irandargah-gateway-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 var(--irandargah-spacing-sm) 0;
    color: var(--irandargah-text-primary);
}

.irandargah-gateway-description {
    font-size: 0.875rem;
    color: var(--irandargah-text-secondary);
    margin: 0;
    line-height: 1.6;
}

.irandargah-gateway-toggle-wrapper {
    flex-shrink: 0;
}

.irandargah-toggle {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
    cursor: pointer;
}

.irandargah-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.irandargah-toggle-slider {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background-color: var(--irandargah-bg-tertiary);
    border: 1px solid var(--irandargah-border);
    border-radius: 32px;
    transition: var(--irandargah-transition);
}

.irandargah-toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    right: 4px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: var(--irandargah-transition);
    box-shadow: var(--irandargah-shadow-sm);
}

.irandargah-toggle-input:checked + .irandargah-toggle-slider {
    background-color: var(--irandargah-success);
    border-color: var(--irandargah-success);
}

.irandargah-toggle-input:checked + .irandargah-toggle-slider:before {
    transform: translateX(-28px);
}

.irandargah-gateway-status {
    display: flex;
    gap: var(--irandargah-spacing-sm);
    margin-bottom: var(--irandargah-spacing-lg);
    flex-wrap: wrap;
}

.irandargah-status-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--irandargah-spacing-xs) var(--irandargah-spacing-md);
    border-radius: var(--irandargah-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

.irandargah-status-active {
    background: #D1FAE5;
    color: #065F46;
}

[data-theme="dark"] .irandargah-status-active {
    background: #064E3B;
    color: #D1FAE5;
}

.irandargah-status-inactive {
    background: #FEE2E2;
    color: #991B1B;
}

[data-theme="dark"] .irandargah-status-inactive {
    background: #7F1D1D;
    color: #FEE2E2;
}

.irandargah-sandbox-badge {
    background: #FEF3C7;
    color: #92400E;
    padding: var(--irandargah-spacing-xs) var(--irandargah-spacing-md);
    border-radius: var(--irandargah-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
}

[data-theme="dark"] .irandargah-sandbox-badge {
    background: #78350F;
    color: #FEF3C7;
}

.irandargah-gateway-actions {
    margin-bottom: var(--irandargah-spacing-lg);
}

.irandargah-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--irandargah-spacing-sm);
    padding: var(--irandargah-spacing-md) var(--irandargah-spacing-lg);
    border: none;
    border-radius: var(--irandargah-radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--irandargah-transition);
    font-family: inherit;
    text-decoration: none;
}

.irandargah-btn-primary {
    background: var(--irandargah-primary);
    color: white;
}

.irandargah-btn-primary:hover {
    background: var(--irandargah-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--irandargah-shadow-md);
}

.irandargah-btn-success {
    background: var(--irandargah-success);
    color: white;
}

.irandargah-btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--irandargah-shadow-md);
}

.irandargah-btn-secondary {
    background: var(--irandargah-bg-tertiary);
    color: var(--irandargah-text-primary);
    border: 1px solid var(--irandargah-border);
}

.irandargah-btn-secondary:hover {
    background: var(--irandargah-bg-primary);
}

.btn-icon {
    font-size: 1rem;
}

.irandargah-gateway-settings {
    margin-top: var(--irandargah-spacing-xl);
    padding-top: var(--irandargah-spacing-xl);
    border-top: 1px solid var(--irandargah-border);
    animation: slideDown 0.3s ease-out;
}

.irandargah-settings-sections {
    display: flex;
    flex-direction: column;
    gap: var(--irandargah-spacing-xl);
}

.irandargah-settings-section {
    background: var(--irandargah-bg-secondary);
    padding: var(--irandargah-spacing-lg);
    border-radius: var(--irandargah-radius-lg);
    border: 1px solid var(--irandargah-border);
}

.irandargah-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 var(--irandargah-spacing-lg) 0;
    color: var(--irandargah-text-primary);
    padding-bottom: var(--irandargah-spacing-md);
    border-bottom: 2px solid var(--irandargah-primary);
}

.irandargah-form-group {
    margin-bottom: var(--irandargah-spacing-lg);
}

.irandargah-label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--irandargah-spacing-sm);
    color: var(--irandargah-text-primary);
    display: flex;
    align-items: center;
    gap: var(--irandargah-spacing-sm);
}

.irandargah-help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--irandargah-bg-tertiary);
    color: var(--irandargah-text-secondary);
    font-size: 0.75rem;
    cursor: help;
    border: 1px solid var(--irandargah-border);
}

.irandargah-input,
.irandargah-textarea,
.irandargah-select {
    width: 100%;
    padding: var(--irandargah-spacing-md);
    border: 1px solid var(--irandargah-border);
    border-radius: var(--irandargah-radius-md);
    background: var(--irandargah-bg-primary);
    color: var(--irandargah-text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    transition: var(--irandargah-transition);
}

.irandargah-input:focus,
.irandargah-textarea:focus,
.irandargah-select:focus {
    outline: none;
    border-color: var(--irandargah-primary);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.irandargah-textarea {
    resize: vertical;
    min-height: 100px;
}

.irandargah-checkbox {
    display: flex;
    align-items: center;
    gap: var(--irandargah-spacing-sm);
    cursor: pointer;
}

.irandargah-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.irandargah-readonly-field {
    display: flex;
    align-items: center;
    gap: var(--irandargah-spacing-md);
    padding: var(--irandargah-spacing-md);
    background: var(--irandargah-bg-tertiary);
    border: 1px solid var(--irandargah-border);
    border-radius: var(--irandargah-radius-md);
}

.irandargah-readonly-field code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--irandargah-text-primary);
    word-break: break-all;
}

.irandargah-copy-btn {
    padding: var(--irandargah-spacing-xs) var(--irandargah-spacing-md);
    background: var(--irandargah-primary);
    color: white;
    border: none;
    border-radius: var(--irandargah-radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--irandargah-transition);
}

.irandargah-copy-btn:hover {
    background: var(--irandargah-primary-dark);
}

.irandargah-field-description {
    font-size: 0.75rem;
    color: var(--irandargah-text-secondary);
    margin-top: var(--irandargah-spacing-xs);
    margin-bottom: 0;
}

.irandargah-form-actions {
    display: flex;
    gap: var(--irandargah-spacing-md);
    margin-top: var(--irandargah-spacing-xl);
    padding-top: var(--irandargah-spacing-lg);
    border-top: 1px solid var(--irandargah-border);
}

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

@media (max-width: 768px) {
    .irandargah-dashboard-wrap {
        padding: var(--irandargah-spacing-md);
    }
    
    .irandargah-gateways-grid {
        grid-template-columns: 1fr;
    }
    
    .irandargah-gateway-card-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .irandargah-gateway-toggle-wrapper {
        align-self: flex-end;
    }
    
    .irandargah-form-actions {
        flex-direction: column;
    }
    
    .irandargah-btn {
        width: 100%;
        justify-content: center;
    }
}






