* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    overflow-x: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
    flex-shrink: 0;
}

.nav-button {
    background: #4a90e2;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s;
}

.nav-button:hover {
    background: #357abd;
}

.nav-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.month-year-container {
    position: relative;
}

.month-year-link {
    font-size: 1.5rem;
    font-weight: 600;
    color: #4a90e2;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.75rem;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.month-year-link::after {
    content: '▾';
    font-size: 1rem;
    opacity: 0.7;
}

.month-year-link:hover {
    color: #357abd;
    background: rgba(74, 144, 226, 0.1);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0.5rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    padding: 0.5rem 0;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-section {
    padding: 0.25rem 0;
}

.dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-items {
    display: flex;
    flex-direction: column;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9375rem;
    color: #333;
    text-decoration: none;
    border: none;
    background: none;
    text-align: left;
    width: 100%;
}

.dropdown-item:hover {
    background: #f0f0f0;
}

.dropdown-item.active {
    background: #e8f2ff;
    color: #4a90e2;
    font-weight: 600;
}

.dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 0.5rem 0;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.image-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    background: #e0e0e0;
}

.month-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.month-image:hover {
    opacity: 0.9;
}

.calendar-container {
    background: white;
    padding: 2rem;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

.calendar-grid {
    display: grid;
    grid-template-columns: auto repeat(7, 1fr);
    gap: 0.5rem;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.week-number {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    font-weight: 600;
    color: #666;
    font-size: 0.75rem;
    font-weight: 300;
    padding: 0.25rem 0.5rem 0 0;
    border: 1px solid transparent;
    min-width: 1rem;
    max-width: 2rem;
    flex-shrink: 0;
    padding-top: 0.25rem;
}

.day-header {
    text-align: center;
    font-weight: 600;
    color: #666;
    padding: 0.5rem;
    font-size: 0.875rem;
}

.day-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.875rem;
    background: white;
    transition: all 0.2s;
    padding: 0.25rem;
    position: relative;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.day-number {
    font-weight: 500;
    line-height: 1.2;
}

.day-cell.birthday {
    background: #fff4e6;
    border-color: #ffb84d;
}

.day-cell.birthday .day-number {
    font-weight: 600;
}

.birthday-label {
    font-size: 0.6rem;
    color: #d97706;
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
    margin-top: 0.15rem;
    padding: 0.1rem 0.2rem;
    background: rgba(255, 184, 77, 0.2);
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.day-cell.holiday {
    background: #ffebee;
    border-color: #ef5350;
}

.day-cell.holiday .day-number {
    font-weight: 600;
}

.holiday-label {
    font-size: 0.6rem;
    color: #c62828;
    font-weight: 500;
    text-align: center;
    line-height: 1.1;
    margin-top: 0.15rem;
    padding: 0.1rem 0.2rem;
    background: rgba(239, 83, 80, 0.2);
    border-radius: 3px;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.day-cell:hover {
    background: #f0f0f0;
    transform: scale(1.05);
}

.day-cell.other-month {
    color: #ccc;
    background: #fafafa;
}

.day-cell.today {
    background: #4a90e2;
    color: white;
    font-weight: 600;
}

/* Wide screens (laptop/desktop) - side by side layout */
@media (min-width: 1024px) {
    .main-content {
        flex-direction: row;
        height: 100%;
    }

    .image-container {
        flex: 0 0 50%;
        max-width: 50%;
        height: 100%;
    }

    .calendar-container {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        box-shadow: -2px 0 8px rgba(0,0,0,0.1);
        min-width: 0;
    }

    .month-image {
        object-fit: cover;
    }
}

/* Tablet - keep vertical but optimize image height */
@media (min-width: 768px) and (max-width: 1023px) {
    .image-container {
        flex: 0 0 40vh;
        min-height: 300px;
    }
}

/* Mobile - vertical stack with optimized image */
@media (max-width: 767px) {
    .header {
        padding: 1rem;
    }

    .month-year-link {
        font-size: 1.25rem;
    }

    .dropdown-menu {
        left: 0;
        transform: none;
        right: 0;
        width: calc(100vw - 2rem);
        margin-left: -1rem;
    }

    .nav-button {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .image-container {
        flex: 0 0 35vh;
        min-height: 250px;
    }

    .calendar-container {
        padding: 1rem;
        overflow-x: hidden;
    }

    .calendar-grid {
        gap: 0.25rem;
        max-width: 100%;
    }

    .day-header {
        font-size: 0.75rem;
        padding: 0.25rem;
    }

    .week-number {
        font-size: 0.65rem;
        padding: 0.25rem 0.1rem;
        min-width: 1.5rem;
        max-width: 1.5rem;
    }

    .day-cell {
        font-size: 0.75rem;
        padding: 0.2rem;
    }

    .birthday-label {
        font-size: 0.5rem;
        padding: 0.05rem 0.1rem;
    }

    .holiday-label {
        font-size: 0.5rem;
        padding: 0.05rem 0.1rem;
    }
}

@media (max-width: 480px) {
    .header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .month-year {
        width: 100%;
        text-align: center;
        order: 1;
    }

    .nav-button {
        flex: 1;
    }

    .image-container {
        flex: 0 0 30vh;
        min-height: 200px;
    }

    .day-cell {
        font-size: 0.625rem;
        padding: 0.15rem;
    }

    .week-number {
        font-size: 0.6rem;
        padding: 0.2rem 0.05rem;
        min-width: 1.25rem;
        max-width: 1.25rem;
    }

    .birthday-label {
        font-size: 0.45rem;
        padding: 0.05rem;
    }

    .holiday-label {
        font-size: 0.45rem;
        padding: 0.05rem;
    }
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
    overflow: auto;
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
    cursor: pointer;
}

.image-modal-img {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    display: block;
    cursor: pointer;
}

.image-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10001;
}

.image-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

@media (max-width: 767px) {
    .image-modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .image-modal-img {
        max-height: 95vh;
    }

    .image-modal-close {
        top: 10px;
        right: 10px;
        font-size: 32px;
        width: 44px;
        height: 44px;
        border-width: 2px;
    }
}

/* Buy Button */
.buy-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4a90e2;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
    z-index: 1000;
    display: inline-block;
}

.buy-button:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.buy-button:active {
    transform: translateY(0);
}

@media (max-width: 767px) {
    .buy-button {
        bottom: 15px;
        right: 15px;
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
    }
}

@media (max-width: 480px) {
    .buy-button {
        bottom: 10px;
        right: 10px;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
}

