/* Custom Styles for Daily Hourly Tracker */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --muted-bg: #f8f9fa;
}

body {
    background-color: #f5f5f5;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header Styles */
header {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Table Styles */
#trackerTable {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#trackerTable thead th {
    position: sticky;
    top: 0;
    background-color: #f8f9fa;
    z-index: 10;
    font-weight: 600;
}

#trackerTable tbody tr {
    transition: background-color 0.2s;
}

#trackerTable tbody tr:hover {
    background-color: #f8f9fa;
}

#trackerTable tbody tr.done-row {
    background-color: #e9ecef;
    opacity: 0.8;
}

#trackerTable tbody tr.highlight-row {
    background-color: #fff3cd !important;
    border-left: 3px solid #ffc107;
}

#trackerTable tbody tr.search-match {
    background-color: #d1ecf1 !important;
}

#trackerTable tbody tr.energy-low {
    border-left: 3px solid #dc3545;
}

#trackerTable tbody tr.energy-high {
    border-left: 3px solid #198754;
}

#trackerTable input[type="text"],
#trackerTable input[type="number"],
#trackerTable select,
#trackerTable textarea {
    border: none;
    background: transparent;
    width: 100%;
    padding: 0.5rem;
}

#trackerTable input[type="text"]:focus,
#trackerTable input[type="number"]:focus,
#trackerTable select:focus,
#trackerTable textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
    background: white;
    border-radius: 4px;
}

#trackerTable textarea {
    resize: vertical;
    min-height: 60px;
}

/* Energy Buttons */
.energy-buttons {
    display: flex;
    gap: 2px;
}

.energy-buttons .btn {
    flex: 1;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.energy-buttons .btn.active {
    font-weight: bold;
}

/* Tag Badges */
.tag-badge {
    cursor: pointer;
    position: relative;
}

.tag-badge .btn-close {
    font-size: 0.7rem;
    margin-left: 0.25rem;
    opacity: 0.5;
}

.tag-badge:hover .btn-close {
    opacity: 1;
}

/* Auto-save Indicator */
#autoSaveIndicator {
    animation: pulse 2s infinite;
}

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

/* Summary Section */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
}

.card-header {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Search Box */
#searchBox {
    border-radius: 0.5rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .energy-buttons {
        flex-direction: column;
    }
    
    #trackerTable {
        font-size: 0.875rem;
    }
    
    .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.75rem;
    }
}

/* Print Styles */
@media print {
    @page {
        size: A4;
        margin: 1.5cm;
    }
    
    body {
        background: white;
        font-size: 10pt;
    }
    
    /* Hide non-essential elements */
    header .btn,
    #settingsPanel,
    #searchBox,
    .btn,
    .card:last-child,
    .toast-container,
    .modal {
        display: none !important;
    }
    
    header {
        background: white;
        box-shadow: none;
        padding: 0.5rem 0;
        border-bottom: 2px solid #000;
        margin-bottom: 1rem;
    }
    
    h1 {
        font-size: 18pt;
        margin-bottom: 0.5rem;
    }
    
    #datePicker {
        border: none;
        font-weight: bold;
        padding: 0;
    }
    
    /* Table Styles for Print */
    #trackerTable {
        border-collapse: collapse;
        width: 100%;
        font-size: 9pt;
        box-shadow: none;
    }
    
    #trackerTable thead th {
        background-color: #f0f0f0 !important;
        border: 1px solid #000;
        padding: 0.3rem;
        font-weight: bold;
    }
    
    #trackerTable tbody td {
        border: 1px solid #ccc;
        padding: 0.3rem;
        vertical-align: top;
    }
    
    #trackerTable tbody tr.done-row {
        background-color: #f5f5f5;
    }
    
    #trackerTable input[type="text"],
    #trackerTable input[type="number"],
    #trackerTable select,
    #trackerTable textarea {
        border: none;
        background: transparent;
        padding: 0;
        font-size: 9pt;
    }
    
    #trackerTable textarea {
        min-height: auto;
    }
    
    /* Hide columns if they're hidden in settings */
    .col-output.hidden,
    .col-energy.hidden,
    .col-notes.hidden {
        display: none !important;
    }
    
    /* Hide action buttons in print */
    #trackerTable th:last-child,
    #trackerTable td:last-child {
        display: none !important;
    }
    
    /* Summary Section for Print */
    .card {
        border: 1px solid #000;
        page-break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .card-header {
        background-color: #f0f0f0 !important;
        border-bottom: 1px solid #000;
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .card-body h6 {
        font-size: 11pt;
        font-weight: bold;
        margin-top: 0.5rem;
        margin-bottom: 0.25rem;
    }
    
    .card-body input,
    .card-body textarea {
        border: 1px solid #ccc;
        padding: 0.25rem;
        font-size: 9pt;
    }
    
    /* Page Break */
    .card {
        page-break-inside: avoid;
    }
    
    #trackerTable {
        page-break-inside: auto;
    }
    
    #trackerTable tbody tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

