/* ================================================================
   TIMESHEET THEMES - UI Exploration Options
   ================================================================ */

/* ----------------------------------------------------------------
   THEME 1: Polished Default
   Subtle improvements to typography, spacing, and refinement
   ---------------------------------------------------------------- */
body.theme-polished .box {
    background: #ffffff;
    padding: 26px 36px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
}

body.theme-polished .form-group label {
    font-size: 0.88rem;
    font-weight: 500;
    color: #444;
    letter-spacing: 0.01em;
    margin-bottom: 6px;
}

body.theme-polished .form-control {
    padding: 10px 14px;
    font-size: 0.92rem;
    border-radius: 5px;
    border: 1px solid #d8d8d8;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.theme-polished .form-control:focus {
    border-color: #8A2422;
    box-shadow: 0 0 0 3px rgba(138, 36, 34, 0.1);
}

body.theme-polished .day-input-row {
    border-radius: 8px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
    border: 1px solid #e8e8e8;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

body.theme-polished .day-input-row:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

body.theme-polished .date-label {
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

body.theme-polished .btn-primary {
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(138, 36, 34, 0.2);
}

body.theme-polished .btn-primary:hover {
    box-shadow: 0 4px 12px rgba(138, 36, 34, 0.3);
    transform: translateY(-1px);
}

body.theme-polished .file-upload-area {
    border-radius: 8px;
    border-width: 2px;
    transition: all 0.25s ease;
}

body.theme-polished .upload-title {
    font-size: 0.98rem;
}

body.theme-polished .day-type-radios label {
    font-size: 0.87rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

body.theme-polished .day-type-radios label:hover {
    background-color: rgba(138, 36, 34, 0.05);
}

/* ----------------------------------------------------------------
   THEME 2: Single Box Layout
   All content merged into one unified container
   ---------------------------------------------------------------- */
body.theme-single-box .main-layout {
    flex-direction: column;
    gap: 0;
}

body.theme-single-box .general-inputs-column,
body.theme-single-box .day-inputs-column {
    flex: none;
    width: 100%;
}

body.theme-single-box .general-inputs-column .box {
    margin-bottom: 0;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    padding-bottom: 15px;
}

body.theme-single-box .day-inputs-column .box {
    border-radius: 0 0 12px 12px;
    border-top: 1px solid #e0e0e0;
    padding-top: 15px;
}

body.theme-single-box .box {
    background: #ffffff;
    box-shadow: none;
    border: 1px solid #e0e0e0;
}

body.theme-single-box .general-inputs-column .box {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 30px;
    align-items: flex-end;
}

body.theme-single-box .general-inputs-column .file-upload-container {
    flex: 0 0 100%;
}

body.theme-single-box .general-inputs-column .button-row {
    flex: 0 0 100%;
    margin-bottom: 5px;
}

body.theme-single-box .general-inputs-column .form-group {
    flex: 1 1 200px;
    margin-bottom: 5px;
}

body.theme-single-box .submit-section {
    margin-top: 20px;
}

/* Unified container shadow for single box */
body.theme-single-box .container main {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 0;
}

body.theme-single-box .main-layout {
    padding: 0;
}

/* ----------------------------------------------------------------
   THEME 3: Calendar View
   Days displayed as a calendar grid with click-to-edit
   ---------------------------------------------------------------- */
body.theme-calendar .day-inputs-grid,
body.theme-calendar .day-inputs-box {
    display: none !important;
}

body.theme-calendar .calendar-grid-container {
    display: block !important;
}

.calendar-grid-container {
    display: none;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.calendar-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.2rem;
}

.calendar-legend {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-dot.normal {
    background: #e8f5e9;
    border: 1px solid #4caf50;
}

.legend-dot.overtime {
    background: #e3f2fd;
    border: 1px solid #2196f3;
}

.legend-dot.partial {
    background: #fffde7;
    border: 1px solid #fbc02d;
}

.legend-dot.absence {
    background: #ffebee;
    border: 1px solid #e53935;
}

.legend-dot.off {
    background: #fce4ec;
    border: 1px solid #e91e63;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}

.weekday-label {
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #666;
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    min-height: 60px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    background: #fafafa;
}

.calendar-day:hover {
    border-color: #8A2422;
    box-shadow: 0 2px 8px rgba(138, 36, 34, 0.15);
    transform: scale(1.02);
}

.calendar-day.empty {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.empty:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day .day-number {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}

.calendar-day .day-status {
    font-size: 0.65rem;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.calendar-day.status-normal {
    background: #e8f5e9;
    border-color: #a5d6a7;
}

.calendar-day.status-normal .day-status {
    color: #2e7d32;
}

.calendar-day.status-normal .day-number {
    color: #2e7d32;
}

.calendar-day.status-overtime {
    background: #e3f2fd;
    border-color: #90caf9;
}

.calendar-day.status-overtime .day-status {
    color: #1565c0;
}

.calendar-day.status-overtime .day-number {
    color: #1565c0;
}

/* Full absence - RED */
.calendar-day.status-absence-full {
    background: #ffebee;
    border-color: #ef9a9a;
}

.calendar-day.status-absence-full .day-status {
    color: #c62828;
}

.calendar-day.status-absence-full .day-number {
    color: #c62828;
}

.calendar-day.status-absence-full .day-details {
    color: #c62828;
}

/* Partial absence - YELLOW */
.calendar-day.status-absence-partial {
    background: #fffde7;
    border-color: #fff176;
}

.calendar-day.status-absence-partial .day-status {
    color: #f57f17;
}

.calendar-day.status-absence-partial .day-number {
    color: #f57f17;
}

.calendar-day.status-absence-partial .day-details {
    color: #f57f17;
}

/* Unmodified weekends/holidays - PINK (off) */
.calendar-day.status-off {
    background: #fce4ec;
    border-color: #f8bbd9;
}

.calendar-day.status-off .day-number {
    color: #c2185b;
}

.calendar-day.status-off .day-status {
    color: #c2185b;
}

/* Day details (overtime amount, absence reason) */
.calendar-day .day-details {
    font-size: 0.6rem;
    color: #555;
    margin-top: 2px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 1px 4px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 3px;
}

.calendar-day.status-overtime .day-details {
    color: #1565c0;
    font-weight: 600;
}

/* Day Edit Modal */
.day-edit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.day-edit-modal.visible {
    display: flex;
}

.day-edit-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.day-edit-content h3 {
    margin: 0 0 20px 0;
    color: #8A2422;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.day-edit-content .form-group {
    margin-bottom: 15px;
}

.day-edit-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.day-edit-actions .btn-save {
    background: #8A2422;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.day-edit-actions .btn-cancel {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
}

/* Large screen optimization for Calendar View */
@media (min-width: 1000px) {
    /* Squish content and align header */
    .container, .header-content {
        max-width: 1000px; /* Increased width to fix day alignment */
    }

    /* Reduce vertical padding to fit 1080p */
    body {
        padding-top: 50px !important; /* Override default padding */
    }

    main {
        margin-top: 10px !important;
        margin-bottom: 10px !important;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
    }

    /* Hide Month Overview header to save space */
    .calendar-header {
        display: none !important;
    }

    /* Return to square dates as content is narrower */
    .calendar-day {
        aspect-ratio: 1;
        font-size: 0.85em; /* Scale down content slightly */
    }

    .calendar-day .day-number {
        font-size: 0.9rem;
    }

    .calendar-day .day-status {
        font-size: 0.6rem;
    }

    /* Use CSS Grid with display: contents to rearrange layout structure */
    .main-layout {
        display: grid;
        grid-template-columns: 310px 1fr;
        grid-template-rows: 1fr auto;
        gap: 0 20px; /* Horizontal gap only, vertical handled by margins */
        align-items: start;
    }

    /* Unwrap the columns */
    .general-inputs-column,
    .day-inputs-column {
        display: contents;
    }

    /* Assign grid areas */
    .general-inputs-column .box {
        grid-column: 1;
        grid-row: 1;
        height: 100%; /* Stretch to fill row height */
        margin-bottom: 20px;
        display: flex;
        flex-direction: column;
    }

    .calendar-grid-container {
        grid-column: 2;
        grid-row: 1;
        height: 100%; /* Stretch to fill row height */
        border-radius: 0;
        margin-bottom: 20px;
    }

    .general-inputs-column footer {
        grid-column: 1;
        grid-row: 2;
        padding: 0 20px 20px 20px;
    }

    .submit-section {
        grid-column: 2;
        grid-row: 2;
        margin: 0;
        text-align: center;
        padding-bottom: 20px;
        padding-top: 20px; /* Ensure space between calendar and button */
    }

    /* Hide buttons to save vertical space */
    .button-row {
        display: none !important;
    }

    /* Update Upload Widget Text */
    .upload-browse {
        font-size: 0 !important;
    }
    .upload-browse::after {
        content: "New one created otherwise";
        font-size: 0.85rem;
        display: block;
    }

    .calendar-grid {
        flex: 1;
    }
}

/* ----------------------------------------------------------------
   THEME 4: Calendar Variation 1 - Compact with badges
   ---------------------------------------------------------------- */
body.theme-calendar-v2 .day-inputs-grid,
body.theme-calendar-v2 .day-inputs-box {
    display: none !important;
}

body.theme-calendar-v2 .calendar-grid-container {
    display: block !important;
}

body.theme-calendar-v2 .calendar-grid-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e0e0e0;
}

body.theme-calendar-v2 .calendar-day {
    min-height: 50px;
    border-radius: 6px;
    border-width: 1px;
    background: #ffffff;
}

body.theme-calendar-v2 .calendar-day .day-number {
    font-size: 0.9rem;
}

body.theme-calendar-v2 .calendar-day .day-status {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    font-size: 0;
    margin: 0;
}

body.theme-calendar-v2 .calendar-day.status-normal .day-status {
    background: #4caf50;
}

body.theme-calendar-v2 .calendar-day.status-overtime .day-status {
    background: #2196f3;
}

body.theme-calendar-v2 .calendar-day.status-absence .day-status {
    background: #ff9800;
}

body.theme-calendar-v2 .calendar-header {
    background: linear-gradient(135deg, #37474f 0%, #455a64 100%);
    color: white;
    margin: -20px -20px 20px -20px;
    padding: 15px 20px;
    border-radius: 8px 8px 0 0;
    border-bottom: none;
}

body.theme-calendar-v2 .calendar-header h3 {
    color: white;
}

body.theme-calendar-v2 .legend-item {
    color: rgba(255, 255, 255, 0.9);
}

body.theme-calendar-v2 .weekday-label {
    color: #455a64;
    font-weight: 700;
}

/* ----------------------------------------------------------------
   THEME 5: Calendar Variation 2 - Large cells with detail preview
   ---------------------------------------------------------------- */
body.theme-calendar-v3 .day-inputs-grid,
body.theme-calendar-v3 .day-inputs-box {
    display: none !important;
}

body.theme-calendar-v3 .calendar-grid-container {
    display: block !important;
}

body.theme-calendar-v3 .calendar-grid-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 25px;
}

body.theme-calendar-v3 .calendar-grid {
    gap: 8px;
}

body.theme-calendar-v3 .calendar-day {
    min-height: 80px;
    border-radius: 12px;
    border-width: 2px;
    padding: 8px;
    align-items: flex-start;
    justify-content: flex-start;
}

body.theme-calendar-v3 .calendar-day .day-number {
    font-size: 1.1rem;
    font-weight: 700;
}

body.theme-calendar-v3 .calendar-day .day-status {
    font-size: 0.7rem;
    margin-top: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.7);
}

body.theme-calendar-v3 .calendar-day .day-preview {
    display: block;
    font-size: 0.65rem;
    color: #666;
    margin-top: auto;
    opacity: 0.8;
}

body.theme-calendar-v3 .calendar-day:hover .day-preview {
    opacity: 1;
}

body.theme-calendar-v3 .calendar-day.status-normal {
    background: linear-gradient(135deg, #c8e6c9 0%, #e8f5e9 100%);
}

body.theme-calendar-v3 .calendar-day.status-overtime {
    background: linear-gradient(135deg, #bbdefb 0%, #e3f2fd 100%);
}

body.theme-calendar-v3 .calendar-day.status-absence {
    background: linear-gradient(135deg, #ffe0b2 0%, #fff3e0 100%);
}

body.theme-calendar-v3 .calendar-day.weekend {
    background: linear-gradient(135deg, #f8bbd9 0%, #fce4ec 100%);
}

body.theme-calendar-v3 .calendar-header {
    border-bottom: 3px solid #8A2422;
    margin-bottom: 25px;
}

body.theme-calendar-v3 .calendar-header h3 {
    color: #8A2422;
    font-size: 1.3rem;
}

/* ----------------------------------------------------------------
   Theme Selector Dropdown
   ---------------------------------------------------------------- */
.theme-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 15px;
}

.theme-selector-wrapper label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
}

#theme-selector {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 4px;
    cursor: pointer;
}

#theme-selector:hover {
    background: rgba(255, 255, 255, 0.25);
}

#theme-selector option {
    background: #333;
    color: white;
}