* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --working-hours: #dbeafe;
    --weekend: #fee2e2;
    --overlap: #86efac;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 1rem;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.timezone-selectors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.timezone-input-group {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.timezone-input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
}

input[type="text"],
input[type="date"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 2px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-lg);
}

.suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid var(--border);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: var(--background);
}

.suggestion-item.highlighted {
    background-color: var(--primary-color);
    color: white;
}

.timezone-info {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    min-height: 3rem;
}

.date-selector {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.date-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: var(--surface);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid var(--border);
}

.legend-color.working-hours {
    background: var(--working-hours);
}

.legend-color.weekend {
    background: var(--weekend);
}

.legend-color.overlap {
    background: var(--overlap);
}

.schedule-grid {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    padding: 1.5rem;
}

.grid-header {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 10;
}

.grid-row {
    display: grid;
    grid-template-columns: 100px 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.hour-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.hour-cell {
    padding: 0.75rem;
    border-radius: 6px;
    border: 2px solid var(--border);
    text-align: center;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.hour-cell.working-hours {
    background: var(--working-hours);
    border-color: #93c5fd;
}

.hour-cell.weekend {
    background: var(--weekend);
    border-color: #fca5a5;
}

.hour-cell.overlap {
    background: var(--overlap);
    border-color: #4ade80;
    font-weight: 600;
}

.hour-cell .time {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.hour-cell .date-info {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.hour-cell .day-name {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    header {
        padding: 1.5rem 1rem;
        margin-bottom: 1rem;
    }

    .timezone-selectors {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .timezone-input-group {
        padding: 1rem;
    }

    .date-selector {
        padding: 1rem;
    }

    .legend {
        padding: 1rem;
        gap: 1rem;
    }

    .legend-item {
        font-size: 0.75rem;
    }

    .legend-color {
        width: 20px;
        height: 20px;
    }

    .schedule-grid {
        padding: 1rem;
    }

    .grid-header,
    .grid-row {
        grid-template-columns: 70px 1fr 1fr;
        gap: 0.25rem;
        font-size: 0.75rem;
    }

    .hour-label {
        font-size: 0.75rem;
    }

    .hour-cell {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }

    .hour-cell .time {
        font-size: 0.75rem;
    }

    .hour-cell .date-info,
    .hour-cell .day-name {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .grid-header,
    .grid-row {
        grid-template-columns: 60px 1fr 1fr;
    }

    .hour-cell {
        padding: 0.4rem 0.2rem;
    }
}