/* ==========================================================================
   Settings Page Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.settings-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: calc(var(--space-5xl) + 60px) var(--container-padding) var(--space-4xl);
}

.settings-header {
    margin-bottom: var(--space-3xl);
}

.settings-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 400;
    margin-bottom: var(--space-sm);
}

.settings-header p {
    color: var(--color-text-secondary);
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.settings-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-3xl);
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.settings-sidebar {
    position: sticky;
    top: calc(var(--space-5xl) + 60px);
    height: fit-content;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-2xl);
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--duration-fast) var(--ease-out);
}

.settings-nav-item:hover {
    color: var(--color-text);
    background: var(--color-bg-hover);
}

.settings-nav-item.active {
    color: var(--color-gold);
    background: rgba(201, 169, 98, 0.1);
}

.settings-nav-item svg {
    opacity: 0.7;
}

.settings-nav-item.active svg {
    opacity: 1;
}

.settings-sidebar-footer {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   Content
   -------------------------------------------------------------------------- */
.settings-content {
    min-height: 600px;
}

.settings-section {
    display: none;
    animation: sectionFadeIn 0.3s var(--ease-out);
}

.settings-section.active {
    display: block;
}

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

.section-header {
    margin-bottom: var(--space-2xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.section-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: var(--space-xs);
}

.section-header p {
    color: var(--color-text-secondary);
    font-size: 0.9375rem;
}

/* --------------------------------------------------------------------------
   Settings Form
   -------------------------------------------------------------------------- */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.settings-form .form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.settings-form label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.settings-form input,
.settings-form textarea {
    width: 100%;
    padding: var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--duration-normal) var(--ease-out);
}

.settings-form input:focus,
.settings-form textarea:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.1);
}

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

.settings-form .input-wrapper input {
    padding-left: calc(var(--space-md) * 2 + 18px);
}

/* Input Prefix */
.input-prefix {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--duration-normal) var(--ease-out);
}

.input-prefix:focus-within {
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.1);
}

.input-prefix span {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    background: var(--color-bg-card);
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    border-right: 1px solid var(--color-border);
    white-space: nowrap;
}

.input-prefix input {
    border: none;
    border-radius: 0;
}

.input-prefix input:focus {
    box-shadow: none;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-lg);
}

.form-group-state {
    width: 100px;
}

.form-divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-lg) 0;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: var(--space-sm);
}

.form-section-title.danger {
    color: #e74c3c;
}

/* Specialty Checkboxes */
.specialty-checkboxes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.checkbox-item:hover {
    border-color: var(--color-border-hover);
    background: var(--color-bg-hover);
}

.checkbox-item:has(input:checked) {
    border-color: var(--color-gold);
    background: rgba(201, 169, 98, 0.1);
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-gold);
    cursor: pointer;
}

.checkbox-label {
    font-size: 0.9375rem;
    color: var(--color-text);
    cursor: pointer;
}

@media (max-width: 480px) {
    .specialty-checkboxes {
        grid-template-columns: 1fr;
    }
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding-top: var(--space-lg);
}

/* --------------------------------------------------------------------------
   Avatar Upload
   -------------------------------------------------------------------------- */
.avatar-upload {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    padding: var(--space-xl);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.avatar-preview .avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-gold-dark), var(--color-gold));
    border: 3px solid var(--color-bg);
    box-shadow: 0 0 0 2px var(--color-gold);
}

.avatar-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.avatar-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Danger Zone
   -------------------------------------------------------------------------- */
.danger-zone {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.danger-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    background: rgba(231, 76, 60, 0.05);
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: var(--radius-md);
}

.danger-info h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.danger-info p {
    font-size: 0.8125rem;
    color: var(--color-text-secondary);
}

.btn-outline-danger {
    border: 1px solid rgba(231, 76, 60, 0.5);
    color: #e74c3c;
}

.btn-outline-danger:hover {
    background: rgba(231, 76, 60, 0.1);
    border-color: #e74c3c;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* --------------------------------------------------------------------------
   Toggle Items
   -------------------------------------------------------------------------- */
.notification-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.notification-group h3 {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.toggle-item:hover {
    border-color: var(--color-border-hover);
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.toggle-title {
    font-weight: 500;
}

.toggle-desc {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 26px;
    transition: all var(--duration-normal) var(--ease-out);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: var(--color-text-muted);
    border-radius: 50%;
    transition: all var(--duration-normal) var(--ease-out);
}

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

.toggle-switch input:checked + .toggle-slider::before {
    background: var(--color-bg);
    transform: translateX(22px);
}

/* --------------------------------------------------------------------------
   Data Actions
   -------------------------------------------------------------------------- */
.data-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    align-items: flex-start;
}

.data-hint {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-sidebar {
        position: static;
    }

    .settings-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .settings-nav-item {
        padding: var(--space-sm) var(--space-md);
    }

    .settings-sidebar-footer {
        display: none;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr auto;
    }

    .form-group-state {
        width: 80px;
    }

    .avatar-upload {
        flex-direction: column;
        text-align: center;
    }

    .danger-item {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .settings-nav-item span:not(svg) {
        display: none;
    }

    .settings-nav-item {
        padding: var(--space-md);
    }
}
