@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* General Body/Container Styling */
body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: #fff; /* White background for the tool itself */
    color: #444;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 10px;
}

.calendar-container {
    max-width: 1200px;
    width: 100%;
    padding: 30px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(255, 105, 180, 0.1); /* Soft pink shadow */
    background: #fcf4f7; /* Very light pink background */
}

.header h1 {
    text-align: center;
    margin-bottom: 5px;
    font-size: 30px;
    font-weight: 700;
    color: #ff69b4; /* Hot Pink */
}

.header p {
    text-align: center;
    margin-bottom: 25px;
    color: #777;
    line-height: 1.5;
}

/* Input Form Styling */
.input-form {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    padding: 20px;
    border-radius: 15px;
    background: #fff; /* White input background */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #444;
}

input[type="month"] {
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #ffc0cb; /* Light Pink border */
    outline: none;
    font-size: 16px;
    transition: border-color 0.3s;
    min-width: 200px;
}

input:focus {
    border-color: #ff69b4; /* Hot Pink focus */
}

button {
    margin-top: 25px;
    padding: 12px 25px;
    min-width: 200px;
    border: none;
    border-radius: 12px;
    background-color: #ff69b4; /* Hot Pink */
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

button:hover {
    background-color: #e65a9e; /* Darker Pink */
    transform: translateY(-2px);
}

/* Calendar Display Section */
#calendar-results {
    margin-top: 30px;
}

.calendar-grid-wrapper {
    display: flex;
    gap: 20px;
    overflow-x: auto; /* Allows horizontal scrolling if needed */
    padding-bottom: 10px;
    justify-content: center; /* Center months on larger screens */
}

.month-calendar {
    flex: 1 1 350px; /* Base size for each month */
    min-width: 300px;
    max-width: 400px;
    background: #fff;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.month-calendar h4 {
    text-align: center;
    color: #ff69b4;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}

.day-name {
    font-weight: 600;
    color: #888;
    padding: 8px 0;
}

/* --- Day Cell Structure for Day Number and Chance Symbol --- */
.day-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    padding: 3px 0;
    height: 40px; 
    
    border-radius: 50%;
    margin: 2px;
    line-height: 1.1;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.1s;
}

.day-number {
    font-size: 15px;
    font-weight: 600;
}

.chance-marker {
    font-size: 10px; 
    margin-top: 1px;
    line-height: 1;
}

.empty-cell {
    visibility: hidden;
}

/* --- Color Coding for Dates --- */
.period-day {
    background-color: #ffc0cb; /* Light Pink - Expected Period */
    color: #c93b76;
}

.fertile-day {
    background-color: #a8dadc; /* Light Cyan - Fertile Window */
    color: #1d3557;
}

.ovulation-day {
    background-color: #32cd32; /* Lime Green - Ovulation Day */
    color: #fff;
    box-shadow: 0 0 8px rgba(50, 205, 50, 0.5);
}

/* --- Input Calendar Selection Styles --- */
.selected-period-day {
    background-color: #ffc0cb; /* Light Pink/Red */
    color: #c93b76;
    font-weight: 700;
    border: 2px solid #ff69b4;
    cursor: pointer;
}
.day-cell:not(.disabled):hover {
    background-color: #ffe0e6;
    cursor: pointer;
}
.disabled {
    cursor: not-allowed;
    opacity: 0.5 !important;
}

/* --- Chance Styling --- */
.high-chance-day .chance-marker {
    color: #FF69B4; /* Hot Pink symbol */
    font-weight: 900;
}

.low-chance-day .chance-marker {
    color: #ccc; /* Light gray symbol */
    font-weight: 400;
}
.period-day.low-chance-day {
    /* Ensure text color is inherited from period-day */
    color: #c93b76;
}

/* --- Chance Legend Styling --- */
.chance-high-symbol {
    font-size: 14px;
    color: #FF69B4;
    margin-right: 8px;
    font-weight: 900;
}

.chance-low-symbol {
    font-size: 14px;
    color: #ccc;
    margin-right: 8px;
    font-weight: 900;
}

/* Legend Styling */
.legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
    padding: 15px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.legend-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #444;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    margin-right: 8px;
}

#period-color { background-color: #ffc0cb; border: 1px solid #c93b76;}
#fertile-color { background-color: #a8dadc; border: 1px solid #1d3557;}
#ovulation-color { background-color: #32cd32; border: 1px solid #1d3557;}

/* Responsive adjustments */
@media (max-width: 1100px) {
    .calendar-grid-wrapper {
        flex-wrap: wrap;
        justify-content: center;
    }
    .month-calendar {
        flex: 1 1 45%;
    }
}

@media (max-width: 768px) {
    .calendar-container {
        padding: 20px;
    }
    .input-form {
        flex-direction: column;
        gap: 15px;
    }
    .month-calendar {
        flex: 1 1 100%; /* Stack on small screens */
        min-width: auto;
    }
}