* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #161b33 0%, #0d0c1d 100%);
    min-height: 100vh;
    padding: 20px;
    color: #161b33;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: #fcf8f3;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(13, 12, 29, 0.5);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #161b33 0%, #474973 100%);
    color: #fcf8f3;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 600;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.btn {
    padding: 10px 20px;
    background: rgba(166, 156, 172, 0.3);
    border: 2px solid rgba(166, 156, 172, 0.5);
    color: #fcf8f3;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    background: rgba(166, 156, 172, 0.5);
    border-color: rgba(166, 156, 172, 0.7);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.date-display {
    font-size: 1.2em;
    font-weight: 500;
    opacity: 0.95;
}

.table-container {
    overflow-x: auto;
    max-height: 80vh;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #474973;
    color: #fcf8f3;
}

thead th {
    padding: 15px 12px;
    text-align: center;
    font-weight: 600;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    position: relative;
    user-select: none;
    cursor: move;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

thead th:first-child {
    text-align: left;
    padding-left: 20px;
    cursor: default;
}

thead th.draggable {
    cursor: grab;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

thead th.draggable:hover {
    background-color: rgba(166, 156, 172, 0.3);
    transform: translateY(-2px);
}

thead th.draggable:active {
    cursor: grabbing;
}

thead th.draggable::before {
    content: '⋮⋮';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    opacity: 0.6;
    line-height: 1;
    letter-spacing: -2px;
    transition: opacity 0.2s ease;
}

thead th.draggable:hover::before {
    opacity: 0.9;
}

thead th.dragging {
    opacity: 0.4;
    background-color: rgba(166, 156, 172, 0.2);
    transform: scale(0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

thead th.drag-over {
    background-color: rgba(166, 156, 172, 0.5);
    border-left: 4px solid #a69cac;
    border-right: 4px solid #a69cac;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(166, 156, 172, 0.5);
}

thead th.drag-over::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(166, 156, 172, 0.2) 50%, 
        transparent 100%);
    animation: pulse-border 1.5s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
}

.tz-info {
    font-size: 0.75em;
    font-weight: 400;
    opacity: 0.8;
    display: block;
    margin-top: 5px;
}

tbody tr {
    border-bottom: 1px solid #dbd7de;
    transition: background-color 0.2s ease, transform 0.3s ease;
}

tbody tr:hover {
    background-color: #faf0e8;
}

tbody td {
    padding: 12px;
    text-align: center;
    border-right: 1px solid #dbd7de;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

tbody td:first-child {
    text-align: left;
    padding-left: 20px;
    font-weight: 500;
    position: sticky;
    left: 0;
    background: #fcf8f3;
    z-index: 5;
    border-right: 2px solid #a69cac;
    transition: all 0.3s ease;
}

/* Hide UTC column when collapsed */
table.utc-collapsed thead th:first-child,
table.utc-collapsed tbody td:first-child {
    display: none;
}

.btn-toggle {
    margin-left: 10px;
}

tbody tr:hover td:first-child {
    background-color: #faf0e8;
}

tbody tr.highlight-row td:first-child {
    background-color: #f4e2d1;
}

tbody tr.highlight-row:hover td:first-child {
    background-color: #e1ae7e;
}

/* Day-based background colors */
.day-monday {
    background-color: #fcf8f3;
}

.day-tuesday {
    background-color: #faf0e8;
}

.day-wednesday {
    background-color: #f7e9dc;
}

.day-thursday {
    background-color: #f4e2d1;
}

.day-friday {
    background-color: #f1dac4;
}

.day-saturday {
    background-color: #edebee;
}

.day-sunday {
    background-color: #dbd7de;
}

/* Highlight current time row */
.highlight-row {
    background-color: #f4e2d1 !important;
    font-weight: 600;
}

.highlight-row td:first-child {
    background-color: #f4e2d1;
}

.highlight-row:hover {
    background-color: #e1ae7e !important;
}

.highlight-row:hover td:first-child {
    background-color: #e1ae7e;
}

/* Row selection highlight with border */
tbody tr.row-selected {
    position: relative;
}

/* Top border on first selected row */
tbody tr.row-selected-start::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: #4a90e2;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

/* Bottom border on last selected row */
tbody tr.row-selected-end::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: #4a90e2;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 -2px 8px rgba(74, 144, 226, 0.4);
}

/* Left border on all selected rows */
tbody tr.row-selected td:first-child {
    position: relative;
}

tbody tr.row-selected td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #4a90e2;
    pointer-events: none;
    z-index: 2;
    box-shadow: -2px 0 8px rgba(74, 144, 226, 0.4);
}

/* Extend top border to connect with first row's top border */
tbody tr.row-selected-start td:first-child::before {
    top: -3px;
}

/* Extend bottom border to connect with last row's bottom border */
tbody tr.row-selected-end td:first-child::before {
    bottom: -3px;
}

/* Right border on all selected rows */
tbody tr.row-selected td:last-child {
    position: relative;
}

tbody tr.row-selected td:last-child::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #4a90e2;
    pointer-events: none;
    z-index: 2;
    box-shadow: 2px 0 8px rgba(74, 144, 226, 0.4);
}

/* Extend top border to connect with first row's top border */
tbody tr.row-selected-start td:last-child::after {
    top: -3px;
}

/* Extend bottom border to connect with last row's bottom border */
tbody tr.row-selected-end td:last-child::after {
    bottom: -3px;
}

/* Make cells selectable */
tbody td {
    user-select: none;
    -webkit-user-select: none;
    cursor: crosshair;
}

tbody td:first-child {
    cursor: default;
}

/* Time cell color variations */
.time-cell {
    position: relative;
}

.time-cell.working-hours {
    background-color: #f1dac4;
    font-weight: 500;
}

/* UTC time column styling */
.utc-time {
    display: flex;
    align-items: center;
    gap: 8px;
}

.clock-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* Responsive design */
@media (max-width: 1200px) {
    table {
        font-size: 12px;
    }
    
    thead th {
        padding: 12px 8px;
    }
    
    tbody td {
        padding: 10px 8px;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .controls {
        flex-wrap: wrap;
    }
    
    .btn {
        padding: 8px 15px;
        font-size: 12px;
    }
}

