/* Task Help System Styles */

/* Help Icon */
.task-help-icon {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 123, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 10px;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.task-help-icon:hover {
    background-color: rgba(0, 123, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.task-help-icon i {
    font-size: 10px;
}

/* Disabled task tiles - dim the help icon */
.task-tile.disabled .task-help-icon {
    background-color: rgba(108, 117, 125, 0.6);
    opacity: 0.7;
}

.task-tile.disabled .task-help-icon:hover {
    background-color: rgba(108, 117, 125, 0.8);
}

/* Help Popup */
.task-help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
    animation: taskHelpFadeIn 0.2s ease-out;
}

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

.task-help-modal {
    background-color: #2c2c2c;
    border: 1px solid #444;
    border-radius: 10px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: taskHelpSlideIn 0.3s ease-out;
}

@keyframes taskHelpSlideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.task-help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #444;
    background-color: #333;
    border-radius: 10px 10px 0 0;
}

.task-help-modal-header h3 {
    margin: 0;
    color: #f4f4f4;
    font-size: 1.1em;
    font-weight: 500;
}

.task-help-modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.task-help-modal-close:hover {
    background-color: #444;
    color: #f4f4f4;
}

.task-help-modal-body {
    padding: 1.5rem;
    color: #f4f4f4;
    line-height: 1.6;
}

.task-help-modal-body p {
    margin: 0;
    font-size: 0.95em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .task-help-modal {
        width: 95%;
        max-width: none;
        margin: 1rem;
    }
    
    .task-help-modal-header {
        padding: 0.75rem 1rem;
    }
    
    .task-help-modal-body {
        padding: 1rem;
    }
    
    .task-help-modal-header h3 {
        font-size: 1em;
    }
}

/* Ensure task tiles have relative positioning for absolute help icon */
.task-tile {
    position: relative;
}

/* Focus styles for accessibility */
.task-help-modal-close:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.task-help-icon:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .task-help-icon {
        background-color: #000;
        border: 2px solid #fff;
    }
    
    .task-help-modal {
        border: 2px solid #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .task-help-overlay {
        animation: none;
    }
    
    .task-help-modal {
        animation: none;
    }
    
    .task-help-icon {
        transition: none;
    }
} 

/* ========================================
   Inline CSS from task_timings.html
   ======================================== */
#taskTimingsContainer {
        padding: 1rem;
        max-width: 1200px;
        margin: 0 auto;
    }

    .info-banner {
        background-color: #2c2c2c;
        border-radius: 10px;
        padding: 1rem;
        margin-bottom: 1.5rem;
        border: 1px solid #444;
    }

    .info-banner p {
        margin: 0;
        color: #f4f4f4;
    }

    .save-toggles-container {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 1.5rem;
        position: relative;
    }

    .save-toggles-btn {
        background-color: #007bff;
        color: white;
        border: none;
        border-radius: 5px;
        padding: 0.5rem 1rem;
        cursor: pointer;
        font-weight: 500;
        display: flex;
        align-items: center;
        transition: background-color 0.3s ease;
        position: relative;
    }

    .save-toggles-btn:hover {
        background-color: #0069d9;
    }

    .save-toggles-btn:hover::after {
        content: "Save current toggle states for future program restarts";
        position: absolute;
        bottom: -40px;
        right: 0;
        background-color: #333;
        color: white;
        padding: 0.5rem;
        border-radius: 5px;
        font-size: 0.875rem;
        white-space: nowrap;
        z-index: 10;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }

    .save-toggles-btn i {
        margin-right: 0.5rem;
    }

    .task-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
        margin-top: 1rem;
    }

    .task-tile {
        height: 100%;
        transition: all 0.3s ease;
        border: 1px solid #444;
        border-radius: 10px;
        background-color: #2c2c2c;
        padding: 1rem;
        cursor: pointer;
        /* Prevent hover from being disrupted by content updates */
        will-change: box-shadow, border-color;
    }

    .task-tile:hover {
        box-shadow: 0 0 20px rgba(0, 123, 255, 0.6);
        border-color: #007bff;
        /* Prevent hover from being disrupted by content updates */
        transition: box-shadow 0.3s ease, border-color 0.3s ease;
    }

    .task-tile.disabled {
        opacity: 0.7;
        background-color: #1a1a1a;
        border-color: #333;
        cursor: default;
    }

    .task-tile.disabled .task-name,
    .task-tile.disabled .countdown,
    .task-tile.disabled small,
    .task-tile.disabled .toggle-label {
        color: #888;
    }

    .countdown {
        font-family: 'Roboto Mono', monospace;
        font-size: 1.2em;
        font-weight: 500;
        color: #f4f4f4;
        text-align: center;
        margin: 1rem 0;
    }

    .task-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .task-name {
        font-size: 1.1em;
        font-weight: 500;
        margin: 0;
        color: #f4f4f4;
    }

    .interval-badge {
        background-color: #007bff;
        color: white;
        padding: 0.25rem 0.5rem;
        border-radius: 0.25rem;
        font-size: 0.875em;
    }

    .disabled .interval-badge {
        background-color: #6c757d;
    }

    .task-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 1rem;
        padding-top: 0.75rem;
        border-top: 1px solid #444;
        position: relative;
        z-index: 5; /* Ensure it's above other elements */
    }

    /* Add a hover effect to make it clear this is interactive */
    .task-toggle:hover .toggle-label {
        color: #007bff;
    }
    
    .toggle-switch {
        position: relative;
        display: inline-block;
        width: 40px;
        height: 20px;
        cursor: pointer;
    }

    .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: #ccc;
        transition: 0.4s;
        border-radius: 20px;
    }

    .toggle-slider:before {
        position: absolute;
        content: "";
        height: 16px;
        width: 16px;
        left: 4px;
        bottom: 2px;
        background-color: white;
        transition: 0.4s;
        border-radius: 50%;
    }

    .toggle-switch input:checked + .toggle-slider {
        background-color: #007bff;
    }

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

    .toggle-switch input:checked + .toggle-slider {
        background-color: #007bff;
    }

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

    .toggle-label {
        margin-left: 0.5rem;
    }

    .tab-container {
        margin-bottom: 1.5rem;
    }

    .tabs {
        display: flex;
        border-bottom: 1px solid #444;
        margin-bottom: 1rem;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        padding: 0.75rem 1rem;
        color: #f4f4f4;
        cursor: pointer;
        border: none;
        background: none;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
    }

    .tab.active {
        color: #007bff;
        border-bottom: 2px solid #007bff;
    }

    .tab-content > div {
        display: none;
    }

    .tab-content > div.active {
        display: block;
    }

    .status-indicator {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        display: inline-block;
        margin-right: 8px;
    }

    .status-indicator.enabled {
        background-color: #28a745;
    }

    .status-indicator.disabled {
        background-color: #dc3545;
    }

    .badge {
        background-color: #6c757d;
        color: white;
        padding: 0.25rem 0.5rem;
        border-radius: 1rem;
        font-size: 0.75em;
        margin-left: 0.5rem;
    }

    /* Label shown next to task names to indicate library specificity */
    .library-label {
        font-size: 0.75em;
        color: #ffc107; /* Gold/yellow to stand out */
        margin-left: 0.5rem;
        font-weight: 500;
        white-space: nowrap;
    }

    .task-tile .interval-details {
        margin-top: 0.5rem;
        margin-bottom: 1rem; /* Space before countdown */
        font-size: 0.9em;
        color: #ccc;
        text-align: center; /* Center interval details */
    }

    .task-tile .interval-input-container {
        margin-top: 0.5rem; /* Space between details and input */
        margin-bottom: 0.75rem; /* Space before toggle */
        display: flex;
        align-items: center;
        justify-content: center; /* Center input group */
        gap: 0.5rem;
    }

    .task-tile .interval-input {
        width: 80px; /* Slightly wider for seconds */
        padding: 0.25rem 0.5rem;
        border: 1px solid #555;
        background-color: #3a3a3a;
        color: #f4f4f4;
        border-radius: 4px;
        text-align: center;
    }
    
    /* Style for when input matches default */
    .task-tile .interval-input.default {
        /* Optional: Add subtle style */
         /* border-color: #007bff; */
    }

    /* Style for when input is custom */
     .task-tile .interval-input.custom {
        /* Optional: Add subtle style */
         border-color: #ffc107; /* Example: yellow border */
    }
    
    .task-tile .interval-input-label {
        font-size: 0.85em;
        color: #aaa;
        /* --- START EDIT: Update label text if needed (or rely on placeholder) --- */
        /* content: "seconds"; Remove if using placeholder */
        /* --- END EDIT --- */
    }
    
    /* Adjust save buttons container */
     .action-buttons-container {
        display: flex;
        justify-content: flex-end;
        gap: 1rem; /* Space between buttons */
        margin-bottom: 1.5rem;
        position: relative;
    }
    /* Update save button styles if needed (reuse existing save-toggles-btn) */

    /* Warning button styles */
    .warning-button {
        background-color: #ffc107;
        color: #212529;
        border: none;
        border-radius: 4px;
        padding: 0.25rem;
        font-size: 0.75em;
        cursor: pointer;
        transition: background-color 0.3s ease;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        bottom: 0.75rem;
        left: 0.75rem;
        z-index: 10;
    }

    .warning-button:hover {
        background-color: #e0a800;
    }

    .warning-button i {
        margin-right: 0.25rem;
    }

    /* Hide media flow container on mobile devices */
    @media (max-width: 768px) {
        .media-flow-container {
            display: none;
        }
    }
