/* Base body styles */
body {
    font-family: 'Roboto', Arial, sans-serif; /* Added Roboto as primary font */
    margin: 0;
    padding: 0;
    background-color: #f4f4f4; /* Fallback background color */
    /* Background Image */
    background-image: url('calendario-gestacionalx.jpg');
    background-size: cover; /* Cover the entire page */
    background-repeat: no-repeat; /* Prevent tiling */
    background-attachment: fixed; /* Keep background fixed during scroll */
    min-height: 100vh; /* Ensure body takes at least full viewport height */
}

/* Glass Effect & General Container Styling */
.container,
.header-compact,
.tool-footer,
.month-container {
    background-color: rgba(255, 255, 255, 0.85); /* Slightly less transparent for better readability */
    backdrop-filter: blur(8px); /* Glass effect */
    -webkit-backdrop-filter: blur(8px); /* For Safari */
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* Softer shadow */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Subtle border for glass effect */
}

/* Header Styling */
.header-compact {
    background-color: #3498db; /* Blue background */
    color: white;
    padding: 15px 20px; /* Adjusted padding */
    text-align: center;
    margin-bottom: 25px; /* Increased spacing */
    /* Glass effect already applied above */
}

.header-compact-content {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px; /* Limit content width */
    margin: 0 auto; /* Center content */
}

.header-logo {
    width: 50px; /* Adjust size as needed */
    height: auto;
    margin-right: 15px; /* Increased space */
}

.header-compact-text {
    text-align: left;
}

.header-compact h1 {
    margin: 0 0 2px 0; /* Small margin bottom */
    font-size: 1.6em; /* Slightly larger */
    font-weight: 700;
}

.header-compact p {
    margin: 0;
    font-size: 0.95em; /* Slightly larger */
}

/* Footer Styling */
.tool-footer {
    background-color: #34495e; /* Dark Gray/Blue background */
    color: #ecf0f1; /* Light text color */
    padding: 15px 20px;
    text-align: center;
    margin-top: 30px; /* Increased spacing */
    font-size: 0.9em; /* Slightly larger */
    /* Glass effect already applied above */
}

.tool-footer-links a {
    color: #bdc3c7; /* Lighter gray for links */
    text-decoration: none;
    margin: 0 8px; /* Increased spacing */
    transition: color 0.3s ease;
}

.tool-footer-links a:hover {
    color: #ffffff; /* White on hover */
}

/* Main application container */
.container {
    width: 95%;
    max-width: 1200px;
    margin: 20px auto; /* Centering */
    /* Glass effect applied above */
}

/* Calendar Grid */
.calendar-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around; /* Distribute months evenly */
    gap: 15px; /* Space between month containers */
}

/* Month Container */
.month-container {
    width: 290px; /* Adjusted width slightly for better fit */
    margin: 10px; /* Keep some margin */
    border: none; /* Remove default border, rely on glass effect */
    padding: 15px; /* Adjusted padding */
    /* Glass effect applied above */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}
/* Background variations (keeping original logic with adjusted alpha) */
.month-container:nth-child(3n+1) { background-color: rgba(250, 240, 230, 0.85); } /* Light Beige */
.month-container:nth-child(3n+2) { background-color: rgba(245, 245, 220, 0.85); } /* Beige */
.month-container:nth-child(3n+3) { background-color: rgba(238, 232, 170, 0.85); } /* Pale Goldenrod */


/* Table Styling */
table {
    border-collapse: collapse;
    margin: 15px 0 0 0; /* Margin top only */
    width: 100%; /* Use full container width */
    table-layout: fixed; /* Fix for alignment issue 1 */
}

th,
td {
    border: 1px solid #ccc; /* Lighter border */
    padding: 5px; /* Slightly reduced padding */
    text-align: center;
    font-size: 0.9em;
    height: 28px; /* Slightly increased height */
    box-sizing: border-box; /* Include padding/border in width calculation */
    word-wrap: break-word; /* Prevent text overflow */
}

th {
    background-color: rgba(242, 242, 242, 0.7); /* Slightly transparent header */
    font-weight: bold;
}

/* Input Area Styling */
.input-container {
    display: flex;
    align-items: center;
    justify-content: center; /* Center input elements */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    margin-bottom: 25px; /* Increased spacing */
    padding: 15px;
    background-color: rgba(230, 230, 230, 0.5); /* Subtle background for input area */
    border-radius: 8px;
}

.input-label {
    font-size: 1.2em; /* Slightly smaller */
    font-weight: bold;
    margin-right: 10px;
    color: #333; /* Ensure label is readable */
}

#lastMenstruationDate {
    padding: 8px 10px;
    font-size: 1em; /* Standard font size */
    width: 160px; /* Slightly wider */
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
}

#calculateButton { /* Style the calculate button specifically */
    padding: 9px 20px;
    font-size: 1em;
    margin-left: 5px;
    /* General button styles from base apply */
    background-color: #3498db; /* Explicitly blue */
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px; /* Added explicit border-radius */
    transition: background-color 0.3s ease; /* Added explicit transition */
}
#calculateButton:hover {
     background-color: #2980b9; /* Darker blue on hover */
}


/* Info Box Styling */
.info-box {
    background-color: rgba(255, 229, 229, 0.9); /* Slightly transparent */
    border: 1px solid #f5c6cb; /* Light red border */
    padding: 15px;
    margin-left: 20px; /* Space from input group */
    border-radius: 5px;
    font-size: 1.1em; /* Adjusted size */
    width: auto; /* Allow width to adjust */
    min-width: 300px; /* Minimum width */
    max-width: 450px; /* Maximum width */
    display: inline-block; /* Keep inline-block */
    vertical-align: middle; /* Align vertically with input */
    word-break: break-word;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    color: #333; /* Default text color */
}

.info-box b {
    color: #721c24; /* Darker red for labels */
}

/* Title Styling */
.year-title {
    font-size: 28px; /* Slightly smaller */
    color: #3498db !important; /* *** FIX: Set color to blue *** */
    text-align: center;
    margin-bottom: 20px;
    background-color: rgba(240, 240, 240, 0.8); /* Slightly transparent */
    padding: 12px;
    border-radius: 5px;
}

/* Print Button Styling */
button[onclick="window.print()"] {
    display: block;
    margin: 30px auto 20px auto; /* Adjusted margins */
    padding: 12px 30px; /* Larger padding */
    font-size: 1.1em; /* Larger font */
    /* Inherits general button styles */
     background-color: #2ecc71; /* Green print button */
     color: white;
     border: none;
     cursor: pointer;
     border-radius: 5px; /* Added explicit border-radius */
     transition: background-color 0.3s ease; /* Added explicit transition */
}
button[onclick="window.print()"]:hover {
     background-color: #27ae60; /* Darker green on hover */
}


/* --- DAY STYLING (Screen) --- */
/* Base cell state */
td {
    background-color: transparent; /* Ensure default is transparent */
    color: #333; /* Default text color */
}

/* 10. Gestation Days: Blue background, white text */
.gestation-day {
    background-color: #3498db !important; /* Blue */
    color: white !important;
}

/* 13. Last Menstruation Day: Red background, white text */
.last-menstruation {
    background-color: #e74c3c !important; /* Red */
    color: white !important;
}

/* 12. Delivery Week: Yellow background (3 days before/after) */
.delivery-week-day {
    background-color: #f1c40f !important; /* Yellow */
    color: #333333 !important; /* Dark text for yellow */
}

/* 12. Probable Delivery Day: Dark Green background, white text */
.probable-delivery {
    background-color: #16a085 !important; /* Dark Green */
    color: white !important;
}