:root {
    --bg-color: #f8f9fa;
    --text-color: #333;
    --border-color: #ddd;
    --active-shadow: 0 0 10px rgba(0,0,0,0.2);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

h1 {
    margin: 0;
    font-size: 24px;
}

/* User Selection Area */
.user-selection {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.user-card {
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fdfdfd;
    justify-content: space-between;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.user-card.active {
    background-color: #fff;
    box-shadow: var(--active-shadow);
    transform: scale(1.05);
}

.user-icon {
    font-size: 20px;
}

.user-input {
    border: none;
    background: transparent;
    font-size: 14px;
    width: 100%;
    padding: 4px;
    border-bottom: 1px solid transparent;
    outline: none;
    flex-grow: 1;
    margin: 0 5px;
    text-align: center;
}

.user-input:read-only {
    pointer-events: none;
    cursor: pointer;
}

.user-input:not(:read-only) {
    border-bottom: 1px solid #666;
    background-color: rgba(255,255,255,0.8);
    cursor: text;
}

.edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 4px;
    border-radius: 4px;
}

.edit-btn:hover {
    opacity: 1;
    background-color: #eee;
}

/* Schedule Grid */
.schedule-container {
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
    max-width: 800px; /* Limit width */
    margin: 0 auto;
}

.grid-header {
    display: grid;
    grid-template-columns: 40px repeat(7, 1fr);
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    text-align: center;
    padding-bottom: 5px;
    margin-bottom: 5px;
    font-size: 12px;
}

.schedule-grid {
    display: grid;
    grid-template-columns: 40px repeat(7, 1fr);
    /* 24 hours */
    grid-template-rows: repeat(24, 25px); /* Reduced height */
}

.time-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #666;
    border-right: 1px solid var(--border-color);
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee; /* Add separator */
}

.grid-cell {
    border-right: 1px solid #eee;
    border-bottom: 1px solid #eee;
    position: relative;
    cursor: pointer;
    transition: background-color 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-cell:hover {
    background-color: #f0f0f0;
}

/* Cell Indicators */
.cell-indicator {
    font-size: 14px; /* Smaller icon */
    z-index: 10;
    pointer-events: none; /* Allow clicks to pass through to cell */
}

.user-icon-small {
    font-size: 12px;
    margin: 1px;
    display: inline-block;
}

.cell-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.missing-users {
    position: absolute;
    bottom: 0;
    right: 0;
    font-size: 8px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    opacity: 0.8;
}

.missing-icon {
    filter: grayscale(100%);
    opacity: 0.7;
}

/* Specific styling for Moon and Sun */
.indicator-moon {
    color: white; /* White icon on orange bg */
    text-shadow: 0 0 2px rgba(0,0,0,0.2);
}

.indicator-sun {
    color: white; /* White icon on green bg */
    text-shadow: 0 0 2px rgba(0,0,0,0.2);
}

/* Full cell background colors */
.cell-moon-bg {
    background-color: rgba(255, 165, 0, 0.6) !important; /* Orange with opacity */
}

.cell-sun-bg {
    background-color: rgba(46, 204, 113, 0.6) !important; /* Green with opacity */
}
