/* Maaltuin Event Agenda CSS */

#mea-agenda-modal-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 9999;
}

#mea-agenda-modal-container .mea-trigger-button {
    background-color: #e9754b;
    color: white;
    width: auto;
    height: auto;
    padding: 0.75rem 1.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    transition: background-color 0.2s;
}

#mea-agenda-modal-container .mea-trigger-button:hover {
    background-color: #d9643a;
}

/* Mobile responsive - hide text on small screens */
@media (max-width: 640px) {
    #mea-agenda-modal-container .mea-trigger-button span {
        display: none;
    }
    
    #mea-agenda-modal-container .mea-trigger-button svg {
        margin-right: 0 !important;
    }
    
    /* Adjust modal positioning on mobile */
    #mea-agenda-modal-container .mea-modal-overlay {
        bottom: 4rem;
        right: 0.5rem;
    }
    
    #mea-agenda-modal-container .mea-modal-content {
        width: calc(100vw - 1rem);
        max-height: 550px; /* Increased mobile height too */
    }
}

#mea-agenda-modal-container .mea-modal-overlay {
    position: fixed;
    bottom: 4.5rem; /* Position above the trigger button */
    right: 1rem;
    background: transparent; /* Remove dark overlay */
    display: block;
    z-index: 9998;
}

#mea-agenda-modal-container .mea-modal-content {
    background-color: white;
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 380px; /* Fixed widget width */
    max-width: calc(100vw - 2rem); /* Responsive fallback */
    max-height: 600px; /* Increased height for better date picker visibility */
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb; /* Add subtle border */
}

#mea-agenda-modal-container .mea-modal-header {
    padding: 0.75rem 1rem 1rem 1rem; /* Added small bottom padding for spacing */
    border-bottom: 1px solid #e5e7eb; /* border-b */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#mea-agenda-modal-container .mea-modal-header h2 {
    margin: 0 !important; /* Remove default H2 margins */
    padding: 0;
    line-height: 1.2;
}

#mea-agenda-modal-container .mea-modal-body {
    padding: 0.75rem 1rem 1rem 1rem; /* Reduced top padding */
    overflow-y: auto;
}

#mea-agenda-modal-container .mea-modal-close-button {
    color: #6b7280; /* text-gray-500 */
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

/* New Styles for Datepicker and Event List */
.mea-datepicker-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: #374151;
}

.mea-datepicker-container {
    margin-bottom: 1rem;
    width: 100%;
}

.mea-datepicker-container input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
}

#mea-datepicker {
    width: 100%;
}

/* Ensure datepicker internal elements are full width */
.datepicker-picker {
    width: 100% !important;
    max-width: 100%;
}

.datepicker-grid {
    width: 100%;
}

.datepicker-cell {
    flex: 1 1 auto;
}

.mea-back-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.mea-events-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.mea-loading-text, .mea-no-events-text {
    color: #6b7280;
    font-style: italic;
}

.mea-event-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mea-event-item {
    list-style: none;
}

.mea-event-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 0.375rem;
    text-decoration: none;
    background-color: #f9fafb;
    transition: background-color 0.2s ease-in-out;
}

.mea-event-link:hover {
    background-color: #f3f4f6;
}

.mea-event-thumbnail {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 0.375rem;
    flex-shrink: 0;
}

.mea-event-info {
    display: flex;
    flex-direction: column;
}

.mea-event-title {
    font-weight: 600;
    color: #1f2937;
    display: block;
}

.mea-event-details {
    font-size: 0.875rem;
    color: #4b5563;
    display: block;
    margin-top: 0.25rem;
}

/* Datepicker Style Overrides */

/* Keep the entire header bar orange */
.datepicker-header {
    
}

/* Navigation buttons */
.datepicker-controls .prev-btn,
.datepicker-controls .next-btn {
    background-color: #e9754b !important;
    background-position: center center !important;
    transition: background-color 0.2s;
    border-radius: 6px !important;
    border: none !important;
    overflow: hidden !important;
}

.datepicker-controls .prev-btn:hover:not(.disabled),
.datepicker-controls .next-btn:hover:not(.disabled) {
    background-color: #d9643a !important;
}

/* Disabled navigation buttons */
.datepicker-controls .prev-btn.disabled,
.datepicker-controls .next-btn.disabled,
.datepicker-controls .prev-btn:disabled,
.datepicker-controls .next-btn:disabled {
    background-color: #9ca3af !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.datepicker-controls .prev-btn.disabled:hover,
.datepicker-controls .next-btn.disabled:hover,
.datepicker-controls .prev-btn:disabled:hover,
.datepicker-controls .next-btn:disabled:hover {
    background-color: #9ca3af !important;
}

/* Month title - always orange, subtle hover */
.datepicker-controls .view-switch {
    background-color: #e9754b !important;
    color: white !important;
    transition: background-color 0.2s;
    border-radius: 6px !important;
    border: none !important;
    overflow: hidden !important;
}

.datepicker-controls .view-switch:hover {
    background-color: #d9643a !important;
    color: white !important;
}

.mea-loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    color: #6b7280;
    font-style: italic;
}

/* Enhanced full-width overrides for datepicker */
.datepicker {
    width: 100% !important;
    max-width: 100% !important;
}

.datepicker table {
    width: 100% !important;
}

.datepicker-header {
    width: 100% !important;
}

.datepicker-controls {
    display: flex;
    justify-content: space-between;
    width: 100% !important;
}

.datepicker-view {
    width: 100% !important;
}

.datepicker-grid {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 0.25rem !important;
    width: 100% !important;
}

.datepicker-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1 !important;
    min-width: 0;
}

.mea-event-placeholder {
    width: 64px;
    height: 64px;
    background-color: #e9754b;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mea-placeholder-logo {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

