:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

.dark {
    --bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
}

* { box-sizing: border-box; transition: all 0.3s ease; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background Decoration */
.background-blobs {
    position: fixed;
    width: 100vw; height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 40%);
}

.settings-container {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
}

.settings-header { margin-bottom: 2.5rem; text-align: center; }
.settings-header h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
.settings-header p { color: var(--text-muted); }

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.settings-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.card-header i { color: var(--primary); font-size: 1.2rem; }
.card-header h2 { font-size: 1.25rem; margin: 0; }

/* Profile Upload Style */
.profile-upload {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.image-wrapper {
    position: relative;
    width: 110px; height: 110px;
}

#previewImage {
    width: 100%; height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary);
}

.upload-btn {
    position: absolute;
    bottom: 0; right: 0;
    background: var(--primary);
    color: white;
    width: 35px; height: 35px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 3px solid var(--bg);
}

/* Inputs */
.input-group { margin-bottom: 1.2rem; }
.input-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-muted);
}

input[type="text"], input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    outline: none;
}

input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); }

/* Custom Switch Toggles */
.toggle-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0;
}

.toggle-info span { display: block; font-weight: 600; }
.toggle-info small { color: var(--text-muted); font-size: 0.8rem; }

.switch {
    position: relative;
    display: inline-block;
    width: 44px; 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: #cbd5e1;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

/* Buttons */
.main-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 2rem;
}

.main-btn:hover { background: var(--primary-hover); transform: translateY(-2px); }

.divider { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    transform: translateX(120%);
    z-index: 1000;
}

.toast.show { transform: translateX(0); }



.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    padding: 8px 16px;
    border-radius: 50px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.back-home-btn i {
    font-size: 0.8rem;
}

.back-home-btn:hover {
    color: var(--primary);
    background: white;
    transform: translateX(-5px); /* حركة خفيفة لليسار عند الهوفر */
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* في حالة الـ Dark Mode يظهر بشكل أوضح */
.dark .back-home-btn:hover {
    background: var(--primary);
    color: white;
}

/* في حالة الـ RTL (العربي) يعكس اتجاه السهم والحركة */
[dir="rtl"] .back-home-btn i {
    transform: rotate(180deg);
}
[dir="rtl"] .back-home-btn:hover {
    transform: translateX(5px);
}