#settingsOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 9997;
}

#settingsOverlay.active {
    opacity: 1;
    visibility: visible;
}

/* Settings Panel */

#settingsPanel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    padding: 25px;
    overflow-y: auto;
    transition: 0.4s ease;
    border-left: 1px solid #eee;
}

#settingsPanel.active {
    right: 0;
}

/* Header */

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.settings-header h4 {
    font-weight: 600;
}

#closeSettingsPanel {
    border: none;
    background: #f4f4f4;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    cursor: pointer;
}

/* Card Sections */

.settings-card {
    background: #fafafa;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 18px;
    border: 1px solid #eee;
}

.settings-card h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Color Picker */

.color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.themeColor {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.themeColor:hover {
    transform: scale(1.2);
}

.themeColor[data-color="#ff6b6b"] {
    background: #ff6b6b;
}
.themeColor[data-color="#1e90ff"] {
    background: #1e90ff;
}
.themeColor[data-color="#28a745"] {
    background: #28a745;
}
.themeColor[data-color="#6f42c1"] {
    background: #6f42c1;
}
.themeColor[data-color="#f39c12"] {
    background: #f39c12;
}
.themeColor[data-color="#17a2b8"] {
    background: #17a2b8;
}

/* Button Groups */

.btn-group-modern {
    display: flex;
    gap: 10px;
}

.btn-group-modern button {
    flex: 1;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    padding: 6px 0;
    cursor: pointer;
    transition: 0.25s;
}

.btn-group-modern button:hover {
    background: #f1f1f1;
}

/* Toggle Switch */

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
}

.slider {
    position: absolute;
    inset: 0;
    background: #ccc;
    border-radius: 30px;
    transition: 0.3s;
}

.slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background: #4caf50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Save Button */

.saveSettingsBtn {
    width: 100%;
    background: linear-gradient(45deg, #5a67ff, #7f9cff);
    border: none;
    color: #fff;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}
/* Floating Settings Button Container */
#floatingSettingsBtn {
    position: fixed;
    top: 60%;
    right: 20px;
    z-index: 9999;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ff3b3b);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);

    transition: all 0.3s ease;

    animation: pulseGlow 3s infinite;
}

/* Gear Icon */
#floatingSettingsBtn i {
    font-size: 22px;
    animation: slowSpin 6s linear infinite;
}

/* Hover Effects */
#floatingSettingsBtn:hover {
    transform: scale(1.15);
    box-shadow: 0 10px 30px rgba(255, 80, 80, 0.6);
}

/* Faster Spin on Hover */
#floatingSettingsBtn:hover i {
    animation: fastSpin 1s linear infinite;
}

/* Slow Default Spin */
@keyframes slowSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Fast Hover Spin */
@keyframes fastSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Glow Pulse Animation */
@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 80, 80, 0.6);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 80, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 80, 80, 0);
    }
}

/* Mobile Optimization */
@media (max-width: 768px) {
    #floatingSettingsBtn {
        width: 50px;
        height: 50px;
        right: 15px;
        top: 70%;
    }

    #floatingSettingsBtn i {
        font-size: 20px;
    }
}
