/* Hook Module Theme Enhancements */

/* Theme Settings Popover */
#theme-settings {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.375rem;
}

/* Quick Settings Buttons */
.btn-group .btn {
    transition: all 0.2s ease-in-out;
}

.btn-group .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Preset Buttons */
.preset-btn {
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.preset-btn:active {
    transform: translateY(0);
}

/* Custom Preset Styling */
.preset-btn[data-preset*="Custom"] {
    background: linear-gradient(45deg, #007bff, #6610f2);
    color: white;
    border-color: #007bff;
}

/* Theme-specific enhancements */
.theme-dark #theme-settings {
    background-color: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.theme-neon .preset-btn {
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.theme-neon .preset-btn:hover {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
}

/* Ambient Sound Toggle Animation */
#sound-toggle i {
    transition: all 0.3s ease;
}

#sound-toggle.btn-outline-success i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Toast Notifications */
.alert.position-fixed {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Preset Modal Enhancements */
.modal-content {
    border-radius: 0.5rem;
    border: none;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.5rem 0.5rem 0 0;
}

/* Loading States */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #theme-settings {
        position: fixed !important;
        top: 10px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
    }
    
    .preset-btn small {
        font-size: 0.7rem;
    }
}

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    border-color: #80bdff;
}

/* Custom Preset Delete Button */
.delete-preset {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.btn-group:hover .delete-preset {
    opacity: 1;
}

/* Stats Cards Enhancement */
.card.bg-info,
.card.bg-success,
.card.bg-warning {
    transition: transform 0.2s ease;
}

.card.bg-info:hover,
.card.bg-success:hover,
.card.bg-warning:hover {
    transform: translateY(-2px);
}

/* Focus Lock Widget Styles */
#focus-lock-widget {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 0.5rem;
    animation: focusLockSlideIn 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

#focus-lock-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: focusLockShimmer 3s infinite;
}

#focus-lock-widget .bi-lock-fill {
    animation: focusLockPulse 2s infinite;
}

#focus-lock-widget .btn-close {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

#focus-lock-widget .btn-close:hover {
    opacity: 1;
}

/* Focus Lock Settings */
#focus-lock-settings .form-control:focus {
    border-color: #ffc107;
    box-shadow: 0 0 0 0.2rem rgba(255, 193, 7, 0.25);
}

#current-domains .badge {
    margin: 0.125rem;
    font-size: 0.75rem;
}

/* Focus Lock Animations */
@keyframes focusLockSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes focusLockPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes focusLockShimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Theme-specific Focus Lock styles */
.timer-theme-dark #focus-lock-widget {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    border-color: #ffc107;
    color: #e2e8f0;
}

.timer-theme-neon #focus-lock-widget {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    border-color: #00ffff;
    color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.timer-theme-retro #focus-lock-widget {
    background: linear-gradient(135deg, #8b4513 0%, #daa520 100%);
    border-color: #ff6347;
    color: #fff;
}

/* Responsive Focus Lock */
@media (max-width: 768px) {
    #focus-lock-widget {
        margin: 0 -15px 1rem -15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    #focus-lock-widget .d-flex {
        flex-direction: column;
        text-align: center;
    }
    
    #focus-lock-widget .btn-close {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }

}
/* In static/css/hook-enhancements.css */

/* Target the theme settings popover by its ID */
#theme-settings {
    /* Set a solid white background with full opacity for maximum contrast */
    background-color: #ffffff !important; 
    /* Ensure the opacity isn't being inherited as transparent */
    opacity: 1.0 !important; 
    /* Adding a defined box-shadow and border improves visual separation from the background */
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(0, 0, 0, 0.1); 
}

/* Ensure the card header and body parts of the popover are also opaque */
#theme-settings .card-header,
#theme-settings .card-body {
    background-color: inherit; /* Inherits the solid white background */
    opacity: 1.0;
}
