.container {
    max-width: 900px;
    margin: 30px auto;
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.header-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.back-btn {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

.header-section h1 {
    margin: 0;
    font-size: 24px;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-section h1 i {
    color: #667eea;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 16px;
}

.loading i {
    margin-left: 10px;
    font-size: 20px;
}

.main-container.hidden {
    display: none;
}

.theme-settings-content {
    padding: 20px 0;
}

.color-picker-group {
    margin-bottom: 35px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.color-picker-group:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.color-label {
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
    color: #212529;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-label i {
    color: #667eea;
    font-size: 18px;
}

.color-input-wrapper {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 15px;
}

.color-picker {
    width: 80px;
    height: 50px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-picker:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.color-text-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    background: white;
    color: #495057;
    cursor: text;
    transition: border-color 0.3s ease;
}

.color-text-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.color-text-input.valid {
    border-color: #28a745;
}

.color-text-input.error {
    border-color: #dc3545;
}

.color-preview {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.save-section {
    margin-top: 40px;
    text-align: center;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.save-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 50px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.save-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.save-btn:active:not(:disabled) {
    transform: translateY(0);
}

.save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.status-message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.status-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* ============================================ */
/* Color Picker Bottom Sheet - طراحی مدرن موبایل */
/* ============================================ */

.color-picker-bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.color-picker-bottom-sheet.active {
    pointer-events: all;
    opacity: 1;
}

.bottom-sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.color-picker-bottom-sheet.active .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: #dee2e6;
    border-radius: 2px;
    margin: 12px auto 8px;
    cursor: grab;
}

.bottom-sheet-handle:active {
    cursor: grabbing;
}

.bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
}

.bottom-sheet-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #212529;
}

.bottom-sheet-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.bottom-sheet-close-btn:active {
    background: #f8f9fa;
    color: #dc3545;
}

/* Tabs */
.color-picker-tabs {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    padding: 0 20px;
    gap: 8px;
}

.color-tab {
    flex: 1;
    padding: 14px 12px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
}

.color-tab i {
    font-size: 16px;
}

.color-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.color-tab:active {
    background: #f8f9fa;
}

/* Tab Content */
.color-picker-tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 300px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* تب 1: Presets */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 8px 0;
}

.preset-color-item {
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.preset-color-item:active {
    transform: scale(0.95);
}

.preset-color-item.selected {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

/* تب 2: Custom Picker */
.custom-picker-container {
    padding: 20px 0;
}

.sb-picker-area {
    width: 100%;
    height: 250px;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
    touch-action: none;
    cursor: crosshair;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sb-picker-bg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-blend-mode: multiply;
}

.sb-picker-handle {
    width: 24px;
    height: 24px;
    border: 3px solid white;
    border-radius: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 10;
}

.hue-slider-container {
    padding: 12px 0;
}

.hue-slider-track {
    width: 100%;
    height: 40px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hue-slider-handle {
    width: 40px;
    height: 40px;
    border: 3px solid white;
    border-radius: 50%;
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 10;
}

/* تب 3: Code Input */
.code-input-container {
    padding: 20px 0;
}

.code-type-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 12px;
}

.code-type-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.code-type-btn.active {
    background: white;
    color: #667eea;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.code-type-btn:active {
    transform: scale(0.98);
}

.code-input-group {
    display: none;
}

.code-input-group.active {
    display: block;
}

.code-input-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.hex-input-wrapper {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 4px;
    border: 2px solid #e9ecef;
    transition: border-color 0.2s ease;
}

.hex-input-wrapper:focus-within {
    border-color: #667eea;
}

.hex-prefix {
    padding: 0 12px;
    font-size: 18px;
    font-weight: 600;
    color: #6c757d;
    font-family: 'Courier New', monospace;
}

.code-input {
    flex: 1;
    padding: 14px 12px;
    border: none;
    background: white;
    border-radius: 8px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #212529;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.code-input:focus {
    outline: none;
}

.rgb-inputs-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.rgb-input-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rgb-input-item label {
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    text-align: center;
}

.rgb-number-input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    background: white;
    color: #212529;
    transition: border-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.rgb-number-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Footer */
.bottom-sheet-footer {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.color-preview-large {
    width: 100%;
    height: 60px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.bottom-sheet-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    min-height: 52px;
}

.action-btn:active {
    transform: scale(0.98);
}

.action-btn.cancel-btn {
    background: #e9ecef;
    color: #495057;
}

.action-btn.cancel-btn:active {
    background: #dee2e6;
}

.action-btn.confirm-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.action-btn.confirm-btn:active {
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* بهبود نمایش color picker در موبایل */
@media (max-width: 768px) {
    .color-picker {
        position: relative;
        cursor: pointer;
    }
    
    .color-picker::-webkit-color-swatch-wrapper {
        padding: 0;
    }
    
    .color-picker::-webkit-color-swatch {
        border: none;
        border-radius: 6px;
    }
    
    .color-picker::-moz-color-swatch {
        border: none;
        border-radius: 6px;
    }
}

/* Responsive برای موبایل کوچک */
@media (max-width: 480px) {
    .presets-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
    }
    
    .sb-picker-area {
        height: 220px;
    }
    
    .bottom-sheet-content {
        max-height: 90vh;
    }
    
    .color-picker-tab-content {
        padding: 16px;
    }
}

