/*
    time-report.css - Styles for the Time Tracker Dashboard (Reporting)
*/

/* --- Base & Utility Styles (Shared/Adapted from time.css) --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

/* Header & Navigation */
.header {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 20px; 
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 12px; 
    text-decoration: none;
    color: #f0f0f0;
    padding: 8px 15px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease;
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
}

.logo-icon {
    line-height: 1;
    font-weight: 300;
}

.btn-back h1 {
    font-size: 24px;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.1s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 16px; 
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

.btn-secondary {
    background: #4b5563;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #374151;
}

/* Main Content Container */
.container {
    max-width: 1200px; 
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

h2 {
    color: #f0f0f0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    margin-bottom: 20px;
}

/* --- Dashboard Specific Styles --- */

/* Metric Cards Grid */
.metrics-grid {
    /* Base: 4 columns for large screens. minmax(200px, 1fr) ensures they don't get too small */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    display: grid;
}

.metric-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    min-height: 90px; 
}

.metric-card h3 {
    font-size: 0.9em;
    color: #a0a0a0;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-weight: 500;
}

.metric-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #3b82f6; /* Primary color for key value */
    margin-bottom: 0; 
    line-height: 1.2;
}

.metric-subvalue {
    font-size: 1.1em;
    color: #10b981; /* Green for secondary value */
    margin-top: 5px; 
    font-weight: 600;
}

/* Styling for the secondary metric that is now on all cards */
.metric-card .secondary-metric {
    font-size: 0.95em; 
    font-weight: 500;
    color: #b0b0b0; /* Neutral color for past period data */
    margin-top: 8px;
}

/* --- Filter Section --- */
.filter-section {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.filter-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Increase spacing below H3 */
.filter-section h3 {
    color: #f0f0f0;
    margin-bottom: 25px; /* Increased space below heading */
}

/* Filter for Notes Checkbox */
.notes-filter-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1em;
    color: #f0f0f0;
    cursor: pointer;
}

.notes-filter-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #3b82f6;
}

/* --- Time Range Selector (Volume Bar Concept) --- */
.time-range-container {
    position: relative;
    padding: 25px 0 0 0; /* Ensures space for the 30px handles above the track */
    user-select: none;
}

/* Visualization Bar (The 'Volume Bar' background) */
.volume-bar-track {
    height: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    position: relative;
}

.volume-bar-active-range {
    position: absolute;
    height: 100%;
    background: #3b82f6; /* Blue active color */
    border-radius: 5px;
    transition: left 0.1s linear, width 0.1s linear;
}

/* Two Range Sliders Overlaid for the Pull Bars */
.range-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0; 
    pointer-events: none; 
}

/* Custom Thumb/Bar Styling - Crucial for "fat finger" mobile design */
.range-thumb-custom {
    position: absolute;
    top: 25px; /* Aligns the top of the handle to the Y-position where the track begins */
    width: 30px; 
    height: 30px; 
    background: #f0f0f0;
    border: 3px solid #3b82f6;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    /* Shifts the handle up by its full height (100%) so its bottom edge rests on the 'top: 25px' line. */
    transform: translate(-50%, -100%); 
}

.range-thumb-custom:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 16px;
    background: #3b82f6;
    border-radius: 2px;
}

/* Date Display now BELOW the range slider */
.date-display-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1em;
    font-weight: 600;
    color: #a0a0a0;
    margin-top: 10px; /* Ensures separation between the slider bar and the dates */
    margin-bottom: 0;
}

/* --- Entry List Section --- */
.entry-list-container {
    min-height: 200px;
}

.entry-list-container h2 {
    color: #a0a0a0;
    font-size: 1.2em;
    border-bottom: none;
    margin-bottom: 15px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    color: #a0a0a0;
    margin-top: 20px;
    width: 100%;
}

.entry-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px; /* Reduced overall card padding */
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px; /* Reduced spacing between entry components (header, time, notes) */
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1em;
    font-weight: 700;
    color: #f0f0f0;
}

.entry-duration {
    color: #3b82f6;
    font-size: 1.4em;
}

.entry-notes {
    padding: 3px 0 0 0; /* Reduced padding after the dashed line */
    border-top: 1px dashed rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
    color: #b0b0b0;
    white-space: wrap;
    overflow-wrap: break-word;
    margin-top: 3px; /* Reduced space above the dashed line */
}

.note-label {
    font-weight: bold;
    color: #f0f0f0;
    margin-right: 5px;
}

.note-row {
	padding: 8px 10px;
    display: flex;
    margin-bottom: 0px; /* Removed margin between note rows for a tighter fit */
}

/* Responsive Adjustments */

/* 4-column layout is the default based on grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); */

/* FORCE 2-COLUMN LAYOUT on screens smaller than 840px (e.g., larger tablets/landscape mobile) */
@media (max-width: 900px) {
    .metrics-grid {
        grid-template-columns: 1fr 1fr; /* Exactly 2 columns wide */
    }
}

/* SMALL MOBILE: Force 1-COLUMN LAYOUT on screens smaller than 600px */
@media (max-width: 550px) {
    .metrics-grid {
        grid-template-columns: 1fr; /* Stack metrics on small mobile */
    }

    .metric-value {
        font-size: 1.6em;
    }

    .filter-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* --- LOADER STYLES (NEW) --- */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Use a dark color that fits the dashboard's theme */
    background-color: #1a1a2e; /* From body gradient start color */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease-out;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #3b82f6; /* Blue-500 from entry-duration */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Initially hide the main content */
#main-content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in, visibility 0.5s;
}

/* Class applied by JS to show the content */
#main-content.loaded {
    opacity: 1;
    visibility: visible;
}


@media (max-width: 700px) {


			.back-btn {
				width: 100px;
			}
			
			
			
	}