/* ========================================
   FLOATING BUTTONS SETTINGS
   Toggle system for floating buttons
   ======================================== */

/* Settings Button (Gear Icon) */
.floating-settings-btn {
    position: fixed;
    bottom: 100px;
    left: 32px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    transition: all 0.3s;
    z-index: 999;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

.floating-settings-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-4px) rotate(90deg);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.5);
}

.floating-settings-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .floating-settings-btn {
        width: 50px;
        height: 50px;
        bottom: 80px;
        left: 24px;
        font-size: 18px;
    }
}

/* Settings Modal */
.floating-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.floating-settings-modal.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Settings Content */
.floating-settings-content {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

/* Settings Header */
.floating-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.floating-settings-header h3 {
    font-size: 22px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.settings-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Settings Body */
.floating-settings-body {
    padding: 28px;
    overflow-y: auto;
    max-height: calc(90vh - 200px);
}

.settings-description {
    background: rgba(245, 158, 11, 0.1);
    padding: 16px;
    border-radius: 12px;
    color: #92400e;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.settings-description i {
    font-size: 18px;
    margin-top: 2px;
    color: #f59e0b;
}

/* Settings Option */
.settings-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 16px;
    transition: all 0.3s;
}

.settings-option:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.settings-option-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.settings-option-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.settings-option-text h4 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.settings-option-text p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

/* Toggle Switch */
.settings-toggle {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
    flex-shrink: 0;
}

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

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

.settings-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.settings-toggle input:checked + .settings-slider {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

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

.settings-toggle input:disabled + .settings-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Settings Actions */
.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 2px solid #e5e7eb;
}

.settings-btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.settings-btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
}

.settings-btn-primary:hover {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.settings-btn-secondary {
    background: white;
    color: #4f46e5;
    border: 2px solid #4f46e5;
}

.settings-btn-secondary:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
}

/* Hidden state for floating buttons */
.floating-quick-add.hidden,
.floating-tracker.hidden,
.back-to-top.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .floating-settings-content {
        max-width: 95%;
        margin: 10px;
    }
    
    .floating-settings-header {
        padding: 20px;
    }
    
    .floating-settings-header h3 {
        font-size: 18px;
    }
    
    .floating-settings-body {
        padding: 20px;
    }
    
    .settings-option {
        padding: 16px;
    }
    
    .settings-option-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .settings-option-text h4 {
        font-size: 14px;
    }
    
    .settings-option-text p {
        font-size: 12px;
    }
    
    .settings-actions {
        flex-direction: column;
    }
    
    .settings-btn {
        width: 100%;
    }
}

/* Accessibility */
.settings-toggle:focus-within .settings-slider {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Animation for button state change */
.floating-quick-add,
.floating-tracker,
.back-to-top {
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}
