/* Linear Calendar Styles */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Calendar Container */
.calendar-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    height: 100%;
}

/* Month Block */
.month-block {
    background: white;
    border-radius: 4px;
    padding: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    width: 100%;
    flex-shrink: 0;
}

.month-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

/* Days Wrapper - contains both day cells and event overlay */
.days-wrapper {
    position: relative;
}

/* Days Container */
.days-container {
    display: flex;
    flex-direction: row;
    gap: 1px;
}

/* Day Cell */
.day-cell {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    border: 1px solid #e5e7eb;
    background: white;
    width: calc((100vw - 350px) / 31);
    min-width: 32px;
    height: 48px;
    flex-shrink: 0;
}

.day-cell.today {
    background: #fef3c7;
    border-color: #f59e0b;
}

.day-cell.weekend {
    background: #dbeafe;
}

/* Day Clickable Area */
.day-clickable {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 14px;
    z-index: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    border-radius: 2px;
}

.day-clickable:hover {
    background: rgba(59, 130, 246, 0.15);
}

.day-number {
    font-size: 0.625rem;
    color: #374151;
    font-weight: 500;
}

.day-cell.today .day-number {
    font-weight: bold;
}

/* Events Layer - overlay for event bars */
.events-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* Event Bar */
.event-bar {
    position: absolute;
    cursor: move;
    border-radius: 3px;
    opacity: 0.85;
    transition: opacity 0.2s, box-shadow 0.2s;
    pointer-events: all;
    display: flex;
    align-items: center;
    overflow: hidden;
    user-select: none;
}

.event-bar:hover {
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.event-bar.selected {
    opacity: 1;
    box-shadow: 0 0 0 2px #1f2937;
    z-index: 11;
}

.event-bar {
    height: 16px;
}

.event-content {
    padding: 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.event-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.event-bar:hover .resize-handle {
    opacity: 1;
}

.resize-left {
    left: 0;
    cursor: ew-resize;
}

.resize-right {
    right: 0;
    cursor: ew-resize;
}

/* Scrollbar styling */
.calendar-container::-webkit-scrollbar {
    height: 8px;
    width: 8px;
}

.calendar-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.calendar-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.calendar-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Print styles */
@media print {
    header {
        position: static;
    }

    .calendar-container {
        overflow: visible;
    }

    button {
        display: none;
    }
}
