/* Base Styles & Variables */
:root {
    /* Colors */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Background Colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --bg-hover: #3a3a3a;
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Border Colors */
    --border-color: #2a2a2a;
    --border-hover: #3a3a3a;
    
    /* Shadow Colors */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-index */
    --z-toast: 1000;
    --z-modal: 900;
    --z-dropdown: 800;
    --z-nav: 700;
}

/* Reset & Base Styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    height: 100%;
}


/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: var(--spacing-md);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

/* Settings Container */
.settings-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px 50px 80px;
}

.page-title {
    text-align: center;
    color: white;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.page-description {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    max-width: 800px;
    margin: 0 auto 50px;
    font-size: 1.1rem;
}

/* Settings Layout */
.settings-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.nav-section {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.section-title {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    width: 100%;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: left;
    margin-bottom: 5px;
}

.nav-item:hover {
    background-color: rgba(222, 92, 52, 0.1);
    color: #de5c34;
}

.nav-item.active {
    background-color: #de5c34;
    color: white;
}

.nav-item i {
    font-size: 1.25rem;
}

/* Settings Content */
.settings-content {
    margin-top: 30px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.settings-card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-color);
}

.settings-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: #de5c34;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.card-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin: 0;
}

.card-content {
    padding: 20px;
}

/* Toggle Switches */
.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.toggle-label {
    flex: 1;
}

.toggle-label h3 {
    color: white;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.toggle-label p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin: 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #3a3a3a;
    transition: 0.3s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #de5c34;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* Custom Select */
.select-group {
    margin-bottom: 20px;
}

.select-group label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.custom-select {
    position: relative;
    width: 100%;
}

.select-button {
    width: 100%;
    padding: 12px 15px;
    background-color: #3a3a3a;
    border: 1px solid #4a4a4a;
    border-radius: 8px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-button:hover {
    border-color: #de5c34;
}

.select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #2e2e2e;
    border: 1px solid #4a4a4a;
    border-radius: 8px;
    margin-top: 5px;
    padding: 5px;
    display: none;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.custom-select.open .select-options {
    display: block;
}

.option {
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    color: white;
}

.option:hover {
    background-color: rgba(222, 92, 52, 0.1);
    color: #de5c34;
}

.option.selected {
    background-color: #de5c34;
    color: white;
}

/* Input Fields */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    color: rgba(255, 255, 255, 0.5);
}

.input-field {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background-color: #3a3a3a;
    border: 1px solid #4a4a4a;
    border-radius: 8px;
    color: white;
    transition: all 0.3s ease;
}

.input-field:focus {
    outline: none;
    border-color: #de5c34;
}

.input-help {
    margin-top: 5px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Buttons */
.button-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 0.9rem;
}

.btn i {
    font-size: 1.2rem;
}

.btn-primary {
    background-color: #de5c34;
    color: white;
}

.btn-primary:hover {
    background-color: #ea6e47;
}

.btn-secondary {
    background-color: #3a3a3a;
    color: white;
}

.btn-secondary:hover {
    background-color: #4a4a4a;
}

.reset-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: rgba(222, 92, 52, 0.1);
    color: #de5c34;
    border: 1px solid #de5c34;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 30px auto;
    font-weight: 500;
}

.reset-button:hover {
    background-color: #de5c34;
    color: white;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background-color: #2e2e2e;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    padding: 15px;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    color: #22c55e;
    font-size: 1.5rem;
}

.toast-message {
    flex: 1;
}

.toast-title {
    display: block;
    color: white;
    font-weight: 600;
    margin-bottom: 5px;
}

.toast-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.toast-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: #22c55e;
    width: 100%;
    transform-origin: left;
    animation: progress 3s linear forwards;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #3a3a3a;
    border-top-color: #de5c34;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

@keyframes progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .settings-container {
        padding: 100px 15px 50px 60px;
    }

    .settings-nav {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Background Preview Styles */
.background-preview {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
}

.preview-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: var(--border-radius);
    background: rgba(0, 0, 0, 0.3);
}

.preview-title {
    position: absolute;
    top: 10px;
    left: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    z-index: 1;
}

.preview-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Background Type Preview Styles */
.preview-content[data-type="grid"] {
    background: linear-gradient(45deg, rgba(255, 102, 0, 0.1) 25%, transparent 25%),
                linear-gradient(-45deg, rgba(255, 102, 0, 0.1) 25%, transparent 25%);
    background-size: 20px 20px;
}

.preview-content[data-type="waves"] {
    background: linear-gradient(180deg, 
        rgba(255, 102, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(255, 102, 0, 0.1) 100%);
    animation: wave-preview 3s ease-in-out infinite;
}

.preview-content[data-type="particles"] {
    background: radial-gradient(circle at center,
        rgba(255, 102, 0, 0.1) 0%,
        transparent 70%);
    animation: particle-preview 4s ease-in-out infinite;
}

.preview-content[data-type="stars"] {
    background: radial-gradient(circle at center,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 70%);
    animation: star-preview 5s ease-in-out infinite;
}

.preview-content[data-type="matrix"] {
    background: linear-gradient(180deg,
        rgba(0, 255, 0, 0.05) 0%,
        transparent 100%);
    animation: matrix-preview 2s linear infinite;
}

.preview-content[data-type="nebula"] {
    background: radial-gradient(circle at center,
        rgba(255, 102, 0, 0.1) 0%,
        rgba(128, 0, 128, 0.1) 50%,
        transparent 100%);
    animation: nebula-preview 8s ease-in-out infinite;
}

.preview-content[data-type="cosmic"] {
    background: radial-gradient(circle at center,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 102, 0, 0.05) 30%,
        rgba(128, 0, 128, 0.05) 60%,
        transparent 100%);
    animation: cosmic-preview 10s ease-in-out infinite;
}

.preview-content[data-type="aurora"] {
    background: linear-gradient(45deg,
        rgba(255, 102, 0, 0.1) 0%,
        rgba(0, 255, 136, 0.1) 30%,
        rgba(128, 0, 128, 0.1) 60%,
        rgba(255, 51, 102, 0.1) 100%);
    animation: aurora-preview 12s ease-in-out infinite;
}

.preview-content[data-type="galaxy"] {
    background: radial-gradient(circle at center,
        rgba(255, 102, 0, 0.1) 0%,
        rgba(128, 0, 128, 0.1) 40%,
        rgba(255, 51, 102, 0.1) 70%,
        transparent 100%);
    animation: galaxy-preview 15s ease-in-out infinite;
}

@keyframes wave-preview {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes particle-preview {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

@keyframes star-preview {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

@keyframes matrix-preview {
    0% { background-position: 0 0; }
    100% { background-position: 0 20px; }
}

@keyframes nebula-preview {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
}

@keyframes cosmic-preview {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}

@keyframes aurora-preview {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

@keyframes galaxy-preview {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
} 