body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Updated font */
    display: flex;
    background-color: #f0f2f5; /* Lighter background */
    flex-direction: column;
    align-items: center;
    margin: 0; /* Remove default margin */
    padding: 20px; /* Add some padding */
    color: #333;
}

h1 {
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.input-container {
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
    align-items: center;
    background-color: #ffffff;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.input-container label {
    font-size: 1.1em;
    color: #555;
}

.input-container input[type="number"] {
    padding: 10px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s ease;
}

.input-container input[type="number"]:focus {
    border-color: #007bff;
}

.input-container button {
    background-color: #007bff; /* Blue button */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.input-container button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

#calendarContainer {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px; /* Increased gap */
    width: 260%; /* Original desktop width */
    max-width: 2100px;
    padding: 20px; /* Add padding to container */
}

/* Mobile styles (default) */
@media (max-width: 767px) {
    #calendarContainer {
        grid-template-columns: 1fr; /* Single column for mobile */
        width: 100%;
        max-width: 90%; /* Max width for mobile container */
        padding: 10px;
    }
    .month-card {
        width: auto; /* Adjust width for auto-sizing within container */
        margin: 0;
    }
}

/* Tablet styles (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    #calendarContainer {
        grid-template-columns: repeat(2, 1fr); /* Two columns for tablet */
        width: 95%;
        max-width: 1200px;
        gap: 25px;
    }
    .month-card {
        width: auto;
    }
}

/* Desktop styles (1024px and up) */
@media (min-width: 1024px) {
    #calendarContainer {
        grid-template-columns: repeat(3, 1fr);
        width: 260%;
        max-width: 2100px;
    }
}

.month-card {
    /* width: 400; Removed fixed width for better responsiveness */
    background-color: white;
    border-radius: 12px; /* More rounded corners */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12); /* Stronger shadow */
    padding: 20px; /* Increased padding */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transitions */
    border: 1px solid #e0e0e0; /* Subtle border */
}

.month-card:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.month-name {
    font-size: 1.4em; /* Larger font */
    font-weight: 700; /* Bolder font */
    margin-bottom: 15px; /* More space below name */
    color: #34495e; /* Darker text for prominence */
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #baccf5; /* Underline effect */
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px; /* Slightly increased gap for day cells */
}

.day-cell {
    border: 1px solid #e9ecef; /* Lighter border */
    padding: 8px; /* Increased padding */
    min-height: 60px; /* Taller cells */
    /* min-width: 100; Removed fixed min-width for flexibility */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.95em; /* Slightly larger font */
    border-radius: 5px; /* Rounded corners for cells */
    background-color: #fdfdff;
    transition: background-color 0.2s ease, transform 0.1s ease;
    position: relative; /* Needed for absolute positioning of tooltip */
    overflow: visible; /* Ensure tooltip is visible */
}

.jd-tooltip {
    position: absolute;
    bottom: 100%; /* Position above the cell */
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    white-space: nowrap;
    z-index: 10; /* Ensure it's above other elements */
    margin-bottom: 5px; /* Space between cell and tooltip */
    opacity: 0.95;
}

.copy-confirm {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #28a745; /* Green for success */
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.9em;
    white-space: nowrap;
    z-index: 11;
    opacity: 1;
    animation: fadeOut 1.5s forwards; /* Animation to fade out */
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; display: none; }
}
.day-cell:hover {
    background-color: #e6f2ff; /* Light blue on hover */
    transform: scale(1.02); /* Slight scale on hover */
}

.day-name {
    font-weight: bold;
    background-color: #baccf5; /* Existing color */
    color: #2c3e50;
    padding: 8px 5px; /* Adjusted padding */
    border-radius: 5px; /* Rounded corners */
    margin-bottom: 5px;
    width: 100%;
    text-align: center;
}

.gregorian-date {
    color: #555; /* Slightly softer color */
    font-weight: 600;
    margin-bottom: 3px;
}

.arabic-date {
    color: #d63031; /* Slightly darker red */
    font-size: 0.85em; /* Slightly smaller font to differentiate */
    font-weight: 500;
}