:root {
    --primary-color: #333;
    --secondary-color: #666;
    --light-gray: #f5f5f5;
    --border-color: #ddd;
    --red-color: #e74c3c;
    --today-color: #3498db;
    --outside-month-bg: #f9f9f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.calendar-container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: white;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 0 10px;
}

.month-year {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    flex: 1;
}

.nav-button {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    padding: 8px 15px;
    color: var(--primary-color);
    transition: all 0.2s ease;
    user-select: none;
}

.nav-button:hover {
    background: var(--light-gray);
    border-color: var(--secondary-color);
}

.nav-button:active {
    transform: scale(0.95);
}

.print-button {
    background: var(--red-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    padding: 10px 20px;
    margin-left: 15px;
    transition: all 0.2s ease;
    user-select: none;
}

.print-button:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

.print-button:active {
    transform: translateY(0);
}

.calendar-grid {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid var(--border-color);
    background: white;
}

.day-header {
    background: var(--light-gray);
    font-weight: bold;
    text-align: center;
    padding: 12px 8px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--primary-color);
}

.day-cell {
    width: 14.28%;
    height: 120px;
    border: 1px solid var(--border-color);
    position: relative;
    vertical-align: top;
    background: white;
    transition: background-color 0.2s ease;
}

.day-cell.outside-month {
    background: var(--outside-month-bg);
    color: var(--secondary-color);
}

.day-cell.today {
    background: #e8f4fd;
    border: 2px solid var(--today-color);
}

.day-number {
    position: absolute;
    top: 5px;
    left: 8px;
    font-size: 12px;
    font-weight: bold;
    color: inherit;
    z-index: 2;
    pointer-events: none;
}

.day-content {
    position: absolute;
    top: 22px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    font-size: 11px;
    line-height: 1.3;
    overflow: hidden;
    outline: none;
    border: none;
    background: transparent;
    padding: 0;
    word-wrap: break-word;
}

.day-content:focus {
    background: rgba(52, 152, 219, 0.05);
    border-radius: 3px;
}

.day-content:empty:before {
    content: "";
    color: #ccc;
}

/* Print Styles */
@media print {
    body {
        padding: 0;
        margin: 0;
        background: white;
    }

    .calendar-header .nav-button,
    .print-button {
        display: none;
    }

    .calendar-container {
        max-width: none;
        width: 100%;
    }

    .calendar-header {
        margin-bottom: 20px;
        justify-content: center;
    }

    .month-year {
        font-size: 24px;
    }

    .calendar-grid {
        width: 100%;
        border: 2px solid #000;
    }

    .day-header {
        border: 1px solid #000;
        background: #f0f0f0;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .day-cell {
        border: 1px solid #000;
        height: 100px;
        background: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .day-cell.outside-month {
        background: #f8f8f8;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .day-cell.today {
        background: white;
        border: 1px solid #000;
    }

    .day-number {
        color: #000;
    }

    .day-content {
        color: #000;
    }

    @page {
        margin: 0.5in;
        size: letter portrait;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .month-year {
        font-size: 24px;
    }

    .day-cell {
        height: 80px;
    }

    .day-content {
        font-size: 10px;
        top: 18px;
    }

    .nav-button {
        font-size: 16px;
        padding: 6px 12px;
    }

    .print-button {
        font-size: 14px;
        padding: 8px 16px;
    }
}