.calendar-app {
    width: 100%;
    height: 100%;
    background: #c0c0c0;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
    display: flex;
    flex-direction: column;
}

/* Toolbar */
.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: linear-gradient(to bottom, #dfdfdf 0%, #c0c0c0 100%);
    border-bottom: 1px solid #808080;
    min-height: 32px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.nav-btn, .today-btn, .view-btn, .month-year-btn {
    background: linear-gradient(to bottom, #dfdfdf 0%, #c0c0c0 100%);
    border: 1px outset #c0c0c0;
    padding: 4px 8px;
    font-size: 11px;
    font-family: 'MS Sans Serif', sans-serif;
    cursor: pointer;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
}

.nav-btn:hover, .today-btn:hover, .view-btn:hover, .month-year-btn:hover {
    background: linear-gradient(to bottom, #e8e8e8 0%, #d0d0d0 100%);
}

.nav-btn:active, .today-btn:active, .view-btn:active, .month-year-btn:active {
    border: 1px inset #c0c0c0;
    background: linear-gradient(to bottom, #c0c0c0 0%, #dfdfdf 100%);
}

.view-btn.active {
    border: 1px inset #c0c0c0;
    background: linear-gradient(to bottom, #c0c0c0 0%, #dfdfdf 100%);
}

.date-display {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-btn {
    min-width: 24px;
    padding: 4px 6px;
}

.today-btn {
    min-width: 50px;
}

.view-btn {
    min-width: 50px;
}

.month-year-btn {
    font-weight: bold;
    min-width: 150px;
}

.view-controls {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

/* Main content area */
.calendar-content {
    display: flex;
    flex-direction: row;
    flex: 1;
}

.calendar-main {
    flex: 1;
    padding: 8px;
    background: white;
    border: 1px inset #c0c0c0;
    margin: 4px;
    overflow: auto;
}

.calendar-sidebar {
    width: 200px;
    background: #c0c0c0;
    border-left: 1px solid #808080;
    padding: 8px;
    overflow-y: auto;
}

/* Calendar Grid */
.calendar-grid {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

.day-header {
    background: linear-gradient(to bottom, #dfdfdf 0%, #c0c0c0 100%);
    border: 1px outset #c0c0c0;
    padding: 4px;
    text-align: center;
    font-weight: bold;
    font-size: 10px;
}

.calendar-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

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

.calendar-day {
    background: white;
    border: 1px solid #c0c0c0;
    padding: 2px;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 40px;
}

.calendar-day:hover {
    background: #e8f4fd;
    border-color: #316ac5;
}

.calendar-day.selected {
    background: #316ac5;
    color: white;
    border-color: #1f4788;
}

.calendar-day.today {
    background: #ffffcc;
    border-color: #ff6600;
    font-weight: bold;
}

.calendar-day.other-month {
    color: #808080;
    background: #f0f0f0;
}

.calendar-day.has-events .day-number {
    font-weight: bold;
}

.day-number {
    font-size: 11px;
    align-self: flex-start;
}

.event-indicator {
    width: 4px;
    height: 4px;
    background: #ff6600;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: 2px;
}

/* Year Grid */
.year-grid {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.year-header {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 16px;
    color: #000080;
}

.year-months {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    flex: 1;
}

.year-month {
    background: white;
    border: 1px inset #c0c0c0;
    padding: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.year-month:hover {
    background: #e8f4fd;
}

.year-month.current {
    background: #ffffcc;
    border-color: #ff6600;
}

.month-name {
    font-weight: bold;
    text-align: center;
    margin-bottom: 4px;
    font-size: 10px;
}

.mini-calendar {
    flex: 1;
}

.mini-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    font-size: 8px;
}

.mini-day {
    text-align: center;
    padding: 1px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-day.other-month {
    color: #c0c0c0;
}

/* Sidebar */
.calendar-sidebar h4 {
    margin: 0 0 8px 0;
    font-size: 11px;
    font-weight: bold;
    color: #000080;
    border-bottom: 1px solid #808080;
    padding-bottom: 2px;
}

.lunar-info, .selected-date-info, .events-section {
    margin-bottom: 16px;
    padding: 8px;
    background: linear-gradient(to bottom, #dfdfdf 0%, #c0c0c0 100%);
    border: 1px inset #c0c0c0;
}

.lunar-date, .lunar-year, .selected-date {
    font-size: 10px;
    margin-bottom: 4px;
    padding: 2px;
    background: white;
    border: 1px inset #c0c0c0;
}

.lunar-year {
    font-style: italic;
    color: #800080;
}

.events-list {
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.event-item {
    background: white;
    border: 1px inset #c0c0c0;
    padding: 4px;
    margin-bottom: 2px;
    font-size: 10px;
    position: relative;
}

.event-time {
    font-weight: bold;
    color: #000080;
}

.event-title {
    margin-top: 2px;
}

.delete-event {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ff6666;
    border: 1px outset #ff6666;
    color: white;
    width: 16px;
    height: 16px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-event:hover {
    background: #ff4444;
}

.no-events {
    font-style: italic;
    color: #808080;
    text-align: center;
    padding: 8px;
}

.add-event-btn {
    width: 100%;
    background: linear-gradient(to bottom, #dfdfdf 0%, #c0c0c0 100%);
    border: 1px outset #c0c0c0;
    padding: 4px 8px;
    font-size: 11px;
    font-family: 'MS Sans Serif', sans-serif;
    cursor: pointer;
}

.add-event-btn:hover {
    background: linear-gradient(to bottom, #e8e8e8 0%, #d0d0d0 100%);
}

.add-event-btn:active {
    border: 1px inset #c0c0c0;
    background: linear-gradient(to bottom, #c0c0c0 0%, #dfdfdf 100%);
}

/* Event Dialog */
.event-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.event-dialog {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    width: 400px;
    max-width: 90vw;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
}

.dialog-header {
    background: linear-gradient(to right, #0a246a 0%, #a6caf0 100%);
    color: white;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialog-header h3 {
    margin: 0;
    font-size: 11px;
    font-weight: bold;
}

.close-dialog {
    background: #c0c0c0;
    border: 1px outset #c0c0c0;
    width: 16px;
    height: 14px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-dialog:hover {
    background: #e0e0e0;
}

.dialog-body {
    padding: 16px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: white;
    border: 1px inset #c0c0c0;
    padding: 2px 4px;
    font-size: 11px;
    font-family: 'MS Sans Serif', sans-serif;
    box-sizing: border-box;
}

.form-group textarea {
    height: 60px;
    resize: vertical;
}

.dialog-footer {
    padding: 8px 16px;
    text-align: right;
    border-top: 1px solid #808080;
}

.save-btn, .cancel-btn {
    background: linear-gradient(to bottom, #dfdfdf 0%, #c0c0c0 100%);
    border: 1px outset #c0c0c0;
    padding: 4px 16px;
    font-size: 11px;
    font-family: 'MS Sans Serif', sans-serif;
    cursor: pointer;
    margin-left: 8px;
}

.save-btn:hover, .cancel-btn:hover {
    background: linear-gradient(to bottom, #e8e8e8 0%, #d0d0d0 100%);
}

.save-btn:active, .cancel-btn:active {
    border: 1px inset #c0c0c0;
    background: linear-gradient(to bottom, #c0c0c0 0%, #dfdfdf 100%);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .calendar-content {
        flex-direction: column;
    }
    
    .calendar-sidebar {
        width: 100%;
        height: 200px;
        border-left: none;
        border-top: 1px solid #808080;
    }
    
    .calendar-toolbar {
        flex-wrap: wrap;
        gap: 4px;
        min-height: auto;
        padding: 8px;
    }
    
    .nav-controls, .date-display, .view-controls {
        margin: 2px 0;
    }
    
    .month-year-btn {
        min-width: 120px;
    }
    
    .year-months {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Scrollbar styling for Windows 95 look */
.calendar-sidebar::-webkit-scrollbar,
.events-list::-webkit-scrollbar {
    width: 16px;
}

.calendar-sidebar::-webkit-scrollbar-track,
.events-list::-webkit-scrollbar-track {
    background: #c0c0c0;
    border: 1px inset #c0c0c0;
}

.calendar-sidebar::-webkit-scrollbar-thumb,
.events-list::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #dfdfdf 0%, #c0c0c0 100%);
    border: 1px outset #c0c0c0;
}

.calendar-sidebar::-webkit-scrollbar-thumb:hover,
.events-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #e8e8e8 0%, #d0d0d0 100%);
}

.calendar-sidebar::-webkit-scrollbar-button,
.events-list::-webkit-scrollbar-button {
    background: linear-gradient(to bottom, #dfdfdf 0%, #c0c0c0 100%);
    border: 1px outset #c0c0c0;
    height: 16px;
}

.calendar-sidebar::-webkit-scrollbar-button:hover,
.events-list::-webkit-scrollbar-button:hover {
    background: linear-gradient(to bottom, #e8e8e8 0%, #d0d0d0 100%);
}