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

/* Enhanced Navigation Design */
.settings-nav {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 8px;
    margin-bottom: 32px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #e0e0e0 transparent;
}

.settings-nav::-webkit-scrollbar {
    height: 6px;
}

.settings-nav::-webkit-scrollbar-track {
    background: transparent;
}

.settings-nav::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 3px;
}

/* Navigation Items Container */
.settings-nav {
    display: flex;
    gap: 4px;
    list-style: none;
    min-width: max-content;
}

/* Navigation Items */
.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #64748b;
    font-weight: 500;
    font-size: 15px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    background: transparent;
    border: 2px solid transparent;
}

/* Hover Effect */
.settings-nav-item:hover {
    background: rgba(0, 102, 255, 0.05);
    color: #0066ff;
    transform: translateY(-1px);
}

/* Active State */
.settings-nav-item.active {
    background: #0066ff;
    color: white;
    box-shadow: 0 4px 16px rgba(0, 102, 255, 0.25);
}

.settings-nav-item.active i {
    color: white;
}

/* Icon Styling */
.settings-nav-item i {
    width: 20px;
    text-align: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

/* Ripple Effect */
.settings-nav-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.settings-nav-item:active::before {
    width: 300px;
    height: 300px;
}

/* Enhanced Toggle Design */
.toggle-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.toggle-group:hover {
    background: #f0f4f8;
    border-color: #e2e8f0;
}

/* Toggle Info Section */
.toggle-info {
    flex: 1;
    margin-right: 24px;
}

.toggle-info strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.toggle-info p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Enhanced Toggle Switch */
.toggle-switch {
    position: relative;
    min-width: 56px;
    height: 32px;
    flex-shrink: 0;
}

.toggle-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: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.toggle-input:checked + .toggle-slider {
    background-color: #0066ff;
    box-shadow: inset 0 2px 4px rgba(0, 102, 255, 0.2);
}

.toggle-input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.2);
}

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

/* Responsive Design */
@media (max-width: 768px) {
    /* Navigation becomes scrollable pills */
    .settings-nav {
        padding: 6px;
        margin: 0 -16px 24px -16px;
        border-radius: 0;
    }
    
    .settings-nav-item {
        padding: 10px 16px;
        font-size: 14px;
        min-width: auto;
    }
    
    .settings-nav-item i {
        font-size: 16px;
    }
    
    /* Stack toggle content on mobile */
    .toggle-group {
        padding: 16px;
    }
    
    .toggle-info {
        margin-right: 16px;
    }
    
    .toggle-info strong {
        font-size: 15px;
    }
    
    .toggle-info p {
        font-size: 13px;
    }
    
    /* Smaller toggle switch on mobile */
    .toggle-switch {
        min-width: 48px;
        height: 28px;
    }
    
    .toggle-slider:before {
        height: 20px;
        width: 20px;
        left: 4px;
        bottom: 4px;
    }
    
    .toggle-input:checked + .toggle-slider:before {
        transform: translateX(20px);
    }
}

@media (max-width: 480px) {
    /* Compact navigation on small screens */
    .settings-nav-item {
        padding: 8px 12px;
        gap: 6px;
    }
    
    /* Show only icons on very small screens */
    .settings-nav-item span {
        display: none;
    }
    
    .settings-nav-item i {
        font-size: 20px;
    }
    
    /* Add tooltip on hover for icon-only navigation */
    .settings-nav-item {
        position: relative;
    }
    
    .settings-nav-item::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: -30px;
        left: 50%;
        transform: translateX(-50%);
        background: #1e293b;
        color: white;
        padding: 4px 8px;
        border-radius: 4px;
        font-size: 12px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .settings-nav-item:hover::after {
        opacity: 1;
    }
    
    /* Very compact toggle on small screens */
    .toggle-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .toggle-info {
        margin-right: 0;
        width: 100%;
    }
    
    .toggle-switch {
        align-self: flex-end;
    }
}

/* Settings Content Card Enhancement */
.settings-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}

.settings-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f1f5f9;
}

/* Form Input Enhancement */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #0066ff;
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

/* Button Enhancement */
.btn-save {
    background: linear-gradient(135deg, #0066ff 0%, #0052cc 100%);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
    padding: 12px 32px;
    font-weight: 600;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 102, 255, 0.4);
}

/* Loading State for Toggle */
.toggle-switch.loading .toggle-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.toggle-switch.loading .toggle-slider:before {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}