/* General Styles */
@font-face {
    font-family: 'GothamSSm-Black';
    src: url('GothamSSm-Black.otf') format('opentype');
}

@font-face {
    font-family: 'Permanent Marker', cursive;
    src: url('https://fonts.googleapis.com/css2?family=Permanent+Marker&display=swap');
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: auto;
    overflow-x: hidden;
    overflow-y: visible;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Container */
.container {
    background: #ffffff;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 20px;
    max-width: 800px;
    width: 100%;
    overflow: visible;
    display: flex;
    flex-direction: column;
    margin-bottom: 50px;
}

/* Title */
h1 {
    font-family: 'GothamSSm-Black', sans-serif;
    font-size: 2.5rem;
    color: #000000;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

/* Featured Flavor */
.featured-flavor {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
    text-align: center;
    padding: 8px;
}

.featured-flavor .title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.featured-flavor .flavor-name {
    font-size: 0;
    padding: 0;
}

.featured-flavor .flavor-image {
    width: 70%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 10px;
}

/* Calendar Navigation */
.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.calendar-navigation button {
    padding: 10px 15px;
    font-size: 14px;
    border: none;
    border-radius: 5px;
    background: linear-gradient(45deg, #fdd835, #ffeb3b);
    color: #333;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 80px;
    border: 1px solid #000000;
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    color: #999;
}

#month-display {
    font-size: 20px;
    font-weight: bold;
    color: #444;
    text-align: center;
}

/* Calendar Grid */
#calendar-container {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 5px;
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
}

/* Calendar Cell */
.calendar-cell {
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease, transform 0.2s ease;
    aspect-ratio: 1 / 1;
    position: relative;
    min-width: 0; /* <-- critical fix: prevents overflow */
}

/* Day Number */
.day-number {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #555;
}

/* Day of Week */
.day-of-week {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 1rem;
    font-weight: bold;
    color: #888;
}

/* Flavor Text */
.flavor-text {
    color: #333;
    font-weight: bold;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.2;
    margin: auto;
}

/* Current Date */
.current-date {
    border: 2px solid #fdd835;
    background: transparent;
    border-radius: 8px;
}

/* Other Month */
.other-month {
    background-color: #f3f3f3 !important;
    color: #999 !important;
    opacity: 0.7;
}

.other-month .day-number,
.other-month .day-of-week,
.other-month .flavor-text {
    color: #999 !important;
}

/* Past Days */
.calendar-cell.past-day {
    background-color: #e0e0e0 !important;
    color: #777 !important;
    opacity: 0.7 !important;
    pointer-events: none;
}

.calendar-cell.past-day .day-number,
.calendar-cell.past-day .day-of-week,
.calendar-cell.past-day .flavor-text {
    color: #777 !important;
}

.calendar-cell.past-day .flavor-text {
    text-decoration: line-through;
}

/* --------- RESPONSIVE --------- */

/* Tablets */
@media (max-width: 992px) {
    #calendar-container {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 5px;
        padding: 5px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .featured-flavor {
        max-width: 300px;
    }
}

/* Phones */
@media (max-width: 576px) {
    #calendar-container {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 4px;
    }

    .calendar-navigation {
        gap: 4px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .featured-flavor {
        max-width: 90%;
    }
}
