/* Settings Page V2 - Sidebar Layout */

.settings-layout {
    display: flex;
    min-height: calc(100vh - 72px);
    background-color: var(--background-color);
}

/* Settings Sidebar */
.settings-sidebar {
    width: 280px;
    background-color: var(--white);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
    flex-shrink: 0;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: #6a6e9e;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.settings-nav-item:hover {
    background: linear-gradient(135deg, #503d7918 0%, #e1a16a30 100%);
    color: #4a4e7c;
    border-color: rgba(98, 103, 163, 0.08);
}

.settings-nav-item.active {
    background: linear-gradient(135deg, #503d792e 0%, #e1a16a52 100%);
    color: #3d4170;
    font-weight: 600;
    border: 1px solid rgb(52 9 91 / 10%);
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Main Content Area */
.settings-main {
    flex: 1;
    padding: 32px 48px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Settings Panels */
.settings-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

.panel-header {
    margin-bottom: 32px;
}

.panel-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.panel-description {
    color: var(--text-secondary);
    font-size: 1rem;
}

.panel-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Info Cards */
.info-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

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

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.info-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    background: linear-gradient(135deg, #503d792e 0%, #e1a16a52 100%);
    color: #3d4170;
    border: 1px solid rgb(52 9 91 / 10%);
}

.role-badge.admin {
    background: linear-gradient(135deg, #ffe4e6 0%, #fecdd3 100%);
    color: #9f1239;
    border-color: rgba(220, 38, 38, 0.15);
}

/* Discord Status */
.discord-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background-color: var(--background-color);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background-color: #ef4444;
}

.status-dot.connected {
    background-color: #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.status-text {
    font-weight: 500;
    color: var(--text-primary);
}

.discord-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.discord-username {
    font-weight: 500;
    color: #5865f2;
}

.info-message {
    display: flex;
    gap: 12px;
    padding: 16px;
    background-color: #eff6ff;
    border-left: 4px solid #3b82f6;
    border-radius: var(--radius-sm);
}

.info-icon {
    width: 20px;
    height: 20px;
    color: #3b82f6;
    flex-shrink: 0;
}

.info-message p {
    color: #1e40af;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background-color: var(--white);
    transition: var(--transition);
}

.input:focus {
    outline: none;
    border-color: #6267a3;
    box-shadow: 0 0 0 3px rgba(98, 103, 163, 0.1);
}

.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button .input {
    flex: 1;
}

.toggle-visibility {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.toggle-visibility:hover {
    background-color: var(--background-color);
}

.toggle-visibility svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

/* Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, 
        #6267a3 0%, 
        #6267a3 var(--value, 70%), 
        #e5e7eb var(--value, 70%), 
        #e5e7eb 100%);
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6267a3 0%, #7b80c4 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(98, 103, 163, 0.4);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6267a3 0%, #7b80c4 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(98, 103, 163, 0.4);
}

.slider-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.form-help {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Preferences */
.preference-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.preference-item:last-child {
    border-bottom: none;
}

.preference-info {
    flex: 1;
}

.preference-label {
    font-weight: 500;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.preference-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.theme-toggle {
    display: flex;
    gap: 8px;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--white);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.theme-option:hover {
    border-color: #7378b5;
}

.theme-option.active {
    background: linear-gradient(135deg, #503d792e 0%, #e1a16a52 100%);
    border-color: rgb(52 9 91 / 15%);
    color: #3d4170;
    font-weight: 600;
}

.theme-option svg {
    width: 20px;
    height: 20px;
}

.input-medium {
    width: 400px;
}

/* Notifications */
.notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-info {
    flex: 1;
}

.notification-label {
    font-weight: 500;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.notification-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.notification-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: var(--transition);
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #c9ccff 0%, #b5b9ff 100%);
    border: 1px solid rgba(98, 103, 163, 0.2);
}

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

.toggle-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.button-secondary-small {
    padding: 6px 12px;
    font-size: 0.875rem;
    background: linear-gradient(135deg, #503d7918 0%, #e1a16a30 100%);
    color: #3d4170;
    border: 1px solid rgb(52 9 91 / 8%);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.button-secondary-small:hover {
    background: linear-gradient(135deg, #503d792e 0%, #e1a16a52 100%);
    border-color: rgb(52 9 91 / 15%);
    color: #3d4170;
}

/* Settings Actions */
.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.button-primary {
    background: linear-gradient(135deg, #503d792e 0%, #e1a16a52 100%);
    color: #3d4170;
    border: 1px solid rgb(52 9 91 / 10%);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button-primary:hover {
    background: linear-gradient(135deg, #503d7945 0%, #e1a16a70 100%);
    transform: translateY(-2px);
    border-color: rgb(52 9 91 / 20%);
}

.button-secondary {
    background-color: var(--white);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.button-secondary:hover {
    background-color: var(--background-color);
    border-color: var(--text-secondary);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.modal-close:hover {
    background-color: var(--background-color);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 24px;
    border-top: 1px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .settings-sidebar {
        width: 240px;
    }
    
    .settings-main {
        padding: 24px 32px;
    }
}

@media (max-width: 768px) {
    .settings-layout {
        flex-direction: column;
    }
    
    .settings-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 16px 0;
    }
    
    .settings-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 16px;
        gap: 8px;
    }
    
    .settings-nav-item {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .settings-main {
        padding: 16px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .preference-item,
    .notification-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .theme-toggle {
        width: 100%;
    }
    
    .theme-option {
        flex: 1;
        justify-content: center;
    }
    
    .input-medium {
        width: 100%;
    }
    
    .settings-actions {
        flex-direction: column;
    }
    
    .settings-actions button {
        width: 100%;
    }
}