.calendar-page {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    padding-top: 80px;
}

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
}

.loading-content {
    text-align: center;
}

.cross-icon {
    font-size: 60px;
    color: var(--accent-color);
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-text {
    font-size: 18px;
    color: var(--primary-color);
    font-family: 'Playfair Display', serif;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

.auto-refresh-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.calendar-container {
    padding: 2rem 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.calendar-header {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-left: 5px solid var(--accent-color);
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.calendar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
}

.calendar-title {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
    position: relative;
    display: inline-block;
}

.calendar-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}

.calendar-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.calendar-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.month-navigation {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-btn {
    background: white;
    border: 2px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 16px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-btn:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.current-month {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--primary-color);
    min-width: 200px;
    text-align: center;
    font-weight: 600;
}

.view-toggles {
    display: flex;
    gap: 0.5rem;
    background: var(--light-color);
    padding: 0.25rem;
    border-radius: 30px;
}

.view-btn {
    padding: 0.5rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: 25px;
    cursor: pointer;
    color: var(--text-color);
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.view-btn:hover {
    color: var(--secondary-color);
    transform: translateY(-1px);
}

.view-btn.active {
    background: var(--secondary-color);
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

.today-btn, .refresh-btn {
    padding: 0.6rem 1.25rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid transparent;
    min-height: 44px;
    white-space: nowrap;
}

.today-btn {
    background: var(--accent-color);
    color: var(--primary-color);
}

.today-btn:hover {
    background: white;
    color: var(--primary-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.refresh-btn {
    background: var(--secondary-color);
    color: white;
}

.refresh-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px) rotate(5deg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.refresh-btn.refreshing {
    animation: rotateRefresh 1s linear infinite;
    pointer-events: none;
}

@keyframes rotateRefresh {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.last-updated {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-calendar {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    align-items: start;
}

.calendar-view {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: none;
    min-height: 700px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.calendar-view.active {
    display: block;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    text-align: center;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
}

.weekday {
    padding: 0.75rem;
    border-right: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

.weekday:last-child {
    border-right: none;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    /* FIX 1: Force 6 equal rows to prevent squished last week */
    grid-template-rows: repeat(6, 1fr);
    gap: 1px;
    background: var(--border-color);
    height: calc(700px - 60px);
    width: 100%;
}

.calendar-day {
    min-height: 110px;
    background: white;
    padding: 0.75rem;
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    /* FIX 1: Remove fixed height calculation, let grid handle it */
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.calendar-grid > .calendar-day:nth-last-child(-n+7) {
    border-bottom: none !important;
}

.calendar-day:hover {
    background: var(--light-color);
    transform: translateY(-2px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1;
}

.calendar-day.other-month {
    background: #f8f9fa;
    color: #adb5bd;
}

.calendar-day.today {
    background: #fff8e1;
    border: 2px solid var(--accent-color);
}

.day-number {
    position: absolute;
    top: 10px;
    right: 10px;
    font-weight: bold;
    color: var(--dark-color);
    font-size: 1.1rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.calendar-day:hover .day-number {
    background: var(--accent-color);
    color: white;
}

.calendar-day.today .day-number {
    background: var(--accent-color);
    color: white;
}

.day-events {
    margin-top: 30px;
    max-height: 85px;
    overflow-y: auto;
}

.day-events::-webkit-scrollbar {
    display: none;
}

.event-dots-container {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-top: 5px;
}

.event-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.list-view {
    display: none;
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    min-height: 700px;
    width: 100%;
    box-sizing: border-box;
}

.list-view.active {
    display: block;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.list-header h2 {
    margin-bottom: 0;
    position: relative;
    display: inline-block;
}

.list-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--accent-color);
}

.filter-select {
    padding: 0.5rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    background: white;
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Source Sans Pro', sans-serif;
    min-width: 200px;
}

.filter-select:hover {
    border-color: var(--secondary-color);
}

.events-list-container {
    max-height: 600px;
    overflow-y: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    width: 100%;
}

.events-list-container::-webkit-scrollbar {
    display: none;
}

.list-event-item {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.list-event-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(44, 62, 80, 0.05), transparent);
    transition: left 0.5s ease;
}

.list-event-item:hover::before {
    left: 100%;
}

.list-event-item:hover {
    background: var(--light-color);
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-color: transparent;
}

.list-event-item.past-event {
    opacity: 0.7;
}

.list-event-date {
    min-width: 70px;
    text-align: center;
    flex-shrink: 0;
    position: relative;
}

.list-event-day {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.list-event-month {
    font-size: 0.85rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.past-badge {
    position: absolute;
    top: -8px;
    right: -5px;
    background: var(--text-secondary);
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
}

.list-event-content {
    flex: 1;
    min-width: 0;
}

.list-event-time {
    font-size: 0.9rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.list-event-title {
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    word-break: break-word;
}

.list-event-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.list-event-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    word-break: keep-all;
}

.list-event-item:hover .list-event-type {
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.calendar-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: fit-content;
    width: 100%;
}

.calendar-widget {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    height: fit-content;
    width: 100%;
    box-sizing: border-box;
}

.calendar-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.widget-month {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin: 0;
    font-weight: 600;
}

.widget-calendar {
    width: 100%;
}

.week-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.5rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-days .calendar-day {
    min-height: 35px;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
}

.calendar-days .calendar-day.today {
    background: var(--accent-color);
    color: white;
    font-weight: 600;
    border-color: var(--secondary-color);
}

.calendar-days .calendar-day .event-dot {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.upcoming-events-widget {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    height: fit-content;
    width: 100%;
    box-sizing: border-box;
}

.upcoming-events-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.upcoming-events-widget h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.upcoming-events-widget h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--accent-color);
}

.upcoming-events-widget h3 i {
    color: var(--accent-color);
}

.upcoming-events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    width: 100%;
}

.upcoming-events-list::-webkit-scrollbar {
    display: none;
}

.upcoming-event-card {
    background: var(--light-color);
    border-radius: 12px;
    padding: 1.2rem;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.upcoming-event-card:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left-color: var(--secondary-color);
}

.upcoming-event-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
    word-break: break-word;
}

.upcoming-event-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.upcoming-event-time {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.event-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.widget-note {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.widget-note p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.news-widget {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    height: fit-content;
    width: 100%;
    box-sizing: border-box;
}

.news-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.news-widget h3 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.news-widget h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--accent-color);
}

.news-widget h3 i {
    color: var(--accent-color);
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
}

.news-list::-webkit-scrollbar {
    display: none;
}

.news-item {
    background: var(--light-color);
    border-radius: 12px;
    padding: 1rem;
    border-left: 4px solid var(--warning-color);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
}

.news-item.warning {
    border-left-color: var(--warning-color);
    background: #fff7ed;
}

.news-item.info {
    border-left-color: var(--primary-color);
    background: var(--light-color);
}

.news-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.news-item p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
}

.news-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

.news-item.warning h4 i {
    color: var(--warning-color);
}

.news-item.info h4 i {
    color: var(--primary-color);
}

.day-events-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    backdrop-filter: blur(5px);
    box-sizing: border-box;
}

.day-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    box-sizing: border-box;
}

.day-modal-content::-webkit-scrollbar {
    display: none;
}

.day-modal-header {
    padding: 1.5rem 1.5rem 1rem;
    background: linear-gradient(135deg, #1a1a1a, #2c3e50);
    color: white;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.day-modal-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
}

.day-modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin: 0;
    flex: 1;
    padding-right: 1rem;
    word-break: break-word;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.day-close-modal {
    background: none;
    border: none;
    color: white !important;
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.day-close-modal:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.day-modal-body {
    padding: 1.5rem;
    box-sizing: border-box;
}

.day-modal-events {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.day-modal-event {
    background: var(--light-color);
    border-radius: 12px;
    padding: 1.25rem;
    border-left: 4px solid;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

.day-modal-event:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.day-modal-event h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    word-break: break-word;
}

.day-modal-time {
    font-size: 0.95rem;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.day-modal-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    word-break: break-word;
}

.day-modal-type {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    word-break: keep-all;
}

.no-events-day {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
    width: 100%;
}

.no-events-day i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border-color);
}

.no-events-day p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.event-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    backdrop-filter: blur(5px);
    box-sizing: border-box;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    box-sizing: border-box;
}

.modal-content::-webkit-scrollbar {
    display: none;
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    background: linear-gradient(135deg, #1a1a1a, #2c3e50);
    color: white;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-color);
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin: 0;
    flex: 1;
    padding-right: 1rem;
    word-break: break-word;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.close-modal {
    background: none;
    border: none;
    color: white !important;
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.close-modal:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
    box-sizing: border-box;
}

.modal-info {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.info-item i {
    color: var(--accent-color);
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.info-label {
    font-weight: 600;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.info-value {
    color: var(--text-color);
    font-size: 0.95rem;
    word-break: break-word;
}

.modal-description {
    background: var(--light-color);
    padding: 1.25rem;
    border-radius: 12px;
    border-left: 3px solid var(--accent-color);
    width: 100%;
    box-sizing: border-box;
}

.modal-description h4 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-description p {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 0;
    word-break: break-word;
}

.modal-footer {
    padding: 0 1.5rem 1.5rem;
    text-align: center;
    display: none;
}

.auto-refresh-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1001;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
    display: none;
    max-width: calc(100vw - 40px);
    box-sizing: border-box;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
    width: 100%;
    box-sizing: border-box;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border-color);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.empty-state small {
    font-size: 0.9rem;
    opacity: 0.8;
}

.event-botez { background-color: #06B6D4; }
.today-event.border-botez { border-left-color: #06B6D4; }

.event-masa { background-color: #F97316; }
.today-event.border-masa { border-left-color: #F97316; }

.event-evanghelizare { background-color: #1D4ED8; }
.today-event.border-evanghelizare { border-left-color: #1D4ED8; }

.event-adunare-seara { background-color: #3B82F6; }
.today-event.border-adunare-seara { border-left-color: #3B82F6; }

.event-adunare-dimineata { background-color: #10B981; }
.today-event.border-adunare-dimineata { border-left-color: #10B981; }

.event-studiu { background-color: #84CC16; }
.today-event.border-studiu { border-left-color: #84CC16; }

.event-cor { background-color: #8B5CF6; }
.today-event.border-cor { border-left-color: #8B5CF6; }

.event-tineri { background-color: #F59E0B; }
.today-event.border-tineri { border-left-color: #F59E0B; }

.event-cina { background-color: #EF4444; }
.today-event.border-cina { border-left-color: #EF4444; }

.event-musafiri { background-color: #64748B; }
.today-event.border-musafiri { border-left-color: #64748B; }

.event-staruintaduhovniceasca { background-color: #7C3AED; }
.today-event.border-staruintaduhovniceasca { border-left-color: #7C3AED; }

.event-slujbaregulara { background-color: #10B981; }
.today-event.border-slujbaregulara { border-left-color: #10B981; }

.event-default { background-color: #6B7280; }
.today-event.border-default { border-left-color: #6B7280; }

/* FIX 2: Mobile styles - dots display horizontally */
@media (max-width: 767px) {
    .calendar-page {
        padding-top: 70px;
    }

    .calendar-container {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .calendar-header {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
        width: 100%;
        border-radius: 12px;
    }

    .calendar-title {
        font-size: 1.8rem;
        word-break: break-word;
    }

    .calendar-subtitle {
        font-size: 1rem;
        word-break: break-word;
    }

    .calendar-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        width: 100%;
    }

    .month-navigation {
        justify-content: center;
        margin-bottom: 0.5rem;
        width: 100%;
    }

    .current-month {
        min-width: auto;
        font-size: 1.3rem;
        word-break: break-word;
    }

    .view-toggles {
        justify-content: center;
        margin: 0.5rem 0;
        width: 100%;
    }

    .action-buttons {
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }

    .today-btn, .refresh-btn {
        flex: 1;
        min-width: 140px;
        justify-content: center;
    }

    .view-btn .btn-text {
        display: none;
    }

    .view-btn {
        padding: 0.5rem;
        min-width: 44px;
        justify-content: center;
    }

    .today-btn .btn-text, .refresh-btn .btn-text {
        display: none;
    }

    .today-btn, .refresh-btn {
        min-width: 44px;
        padding: 0.6rem;
        justify-content: center;
    }

    .today-btn i, .refresh-btn i {
        margin: 0;
    }
    
    .main-calendar {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        width: 100%;
        overflow-x: hidden;
    }

    .calendar-view {
        display: none !important;
        min-height: 0;
        height: 0;
    }
    
    .calendar-view.active {
        display: none !important;
    }

    .calendar-widget {
        display: block !important;
        background: white;
        border-radius: 16px;
        padding: 1.5rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
        border: 1px solid var(--border-color);
        overflow: hidden;
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 1.5rem;
    }

    .widget-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        width: 100%;
    }

    .widget-month {
        font-size: 1.3rem;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0;
        text-align: center;
        flex: 1;
        word-break: break-word;
    }

    .widget-calendar {
        display: flex;
        flex-direction: column;
        width: 100%;
        overflow: hidden;
    }

    .week-days {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 0.1rem;
        margin-bottom: 0.5rem;
        text-align: center;
        font-weight: 600;
        font-size: 0.75rem;
        color: var(--text-secondary);
        width: 100%;
    }

    .calendar-days {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 0.1rem;
        width: 100%;
    }

.calendar-days .calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    min-height: 35px;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
    height: auto !important;
    padding: 2px;
}

.calendar-days .calendar-day:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
    transform: scale(1.05);
    z-index: 2;
}

.calendar-days .calendar-day.other-month {
    color: #cbd5e1;
    background: var(--light-color);
}

.calendar-days .calendar-day.today {
    background: var(--primary-color);
    border-color: var(--secondary-color);
    color: white;
    font-weight: 600;
}

/* FIXED: Dots container for multiple dots */
.calendar-days .calendar-day .event-dots-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 2px;
    margin-top: 2px;
    width: 100%;
    position: static;
}

/* FIXED: Individual dots */
.calendar-days .calendar-day .event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin: 0;
    position: static;
}

/* Make sure today's dots are visible */
.calendar-days .calendar-day.today .event-dot {
    background-color: white !important;
}

    .list-view {
        padding: 1.25rem;
        min-height: auto;
        width: 100%;
        border-radius: 12px;
    }

    .list-header {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .filter-select {
        width: 100%;
        min-width: auto;
        font-size: 0.9rem;
    }

    .list-event-item {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
        width: 100%;
    }

    .list-event-date {
        text-align: left;
        display: flex;
        align-items: center;
        gap: 1rem;
        width: 100%;
    }

    .list-event-day {
        font-size: 1.25rem;
        margin-bottom: 0;
    }

    .list-event-month {
        font-size: 0.8rem;
    }

    .modal-content,
    .day-modal-content {
        margin: 2% auto;
        padding: 0;
        width: 96%;
        max-width: 96%;
        border-radius: 12px;
    }

    .modal-header,
    .day-modal-header {
        padding: 1.25rem 0.75rem 0.75rem;
        border-radius: 12px 12px 0 0;
    }

    .modal-body,
    .day-modal-body {
        padding: 1.25rem 0.75rem;
    }
    
    .modal-header,
    .day-modal-header {
        padding: 1.5rem 1rem 1rem;
        border-radius: 0;
    }
    
    .modal-body,
    .day-modal-body {
        padding: 1.5rem 1rem;
    }

    .modal-content h3,
    .day-modal-title {
        font-size: 1.3rem;
    }
    
    html, body {
        overflow-x: hidden;
        max-width: 100%;
    }
    
    body {
        width: 100%;
        overflow-x: hidden;
    }
    
    .container {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    body::-webkit-scrollbar {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .calendar-container {
        padding: 1.5rem;
        width: 100%;
        max-width: 100%;
    }
    
    .main-calendar {
        grid-template-columns: 1fr;
        gap: 2rem;
        width: 100%;
    }
    
    .calendar-view {
        min-height: 600px !important;
        width: 100%;
    }
    
    .calendar-grid {
        height: calc(600px - 60px) !important;
        width: 100%;
    }
    
    .calendar-day {
        height: calc((600px - 60px) / 6) !important;
    }
    
    .list-view {
        min-height: 600px;
        width: 100%;
    }
    
    .calendar-widget {
        background: white;
        border-radius: 16px;
        padding: 1.5rem;
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
        border: 1px solid var(--border-color);
        overflow: hidden;
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 1.5rem;
        display: block !important;
    }
    
    .widget-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1.5rem;
        width: 100%;
    }
    
    .widget-month {
        font-size: 1.4rem;
        font-weight: 600;
        color: var(--text-primary);
        margin: 0;
        text-align: center;
        flex: 1;
    }
    
    .widget-calendar {
        display: flex;
        flex-direction: column;
        width: 100%;
        overflow: hidden;
    }
    
    .week-days {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 0.15rem;
        margin-bottom: 0.5rem;
        text-align: center;
        font-weight: 600;
        font-size: 0.85rem;
        color: var(--text-secondary);
        width: 100%;
    }
    
    .calendar-days {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 0.15rem;
        width: 100%;
    }
    
    .calendar-days .calendar-day {
        aspect-ratio: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        cursor: pointer;
        font-size: 0.9rem;
        font-weight: 500;
        transition: all 0.3s ease;
        position: relative;
        background: white;
        border: 1px solid var(--border-color);
        color: var(--text-primary);
        min-height: 40px;
        box-sizing: border-box;
        position: relative;
        overflow: visible;
        height: auto !important;
    }
    
    .calendar-days .calendar-day:hover {
        background: var(--light-color);
        border-color: var(--primary-color);
        transform: scale(1.05);
        z-index: 2;
    }
    
    .calendar-days .calendar-day.other-month {
        color: #cbd5e1;
        background: var(--light-color);
    }
    
    .calendar-days .calendar-day.today {
        background: var(--primary-color);
        border-color: var(--secondary-color);
        color: white;
        font-weight: 600;
    }
    
    .calendar-days .calendar-day .event-dots-container {
        position: absolute;
        bottom: 6px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 2px;
        z-index: 3;
        pointer-events: none;
    }
    
    .calendar-days .calendar-day .event-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
    }
    
    .calendar-view {
        display: block !important;
    }
    
    .calendar-view.active {
        display: block !important;
    }
    
    .calendar-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.5rem;
        width: 100%;
    }
    
    .calendar-widget {
        flex: 0 0 calc(50% - 0.75rem);
    }
    
    .upcoming-events-widget,
    .news-widget {
        flex: 0 0 calc(50% - 0.75rem);
    }
    
    body::-webkit-scrollbar {
        display: none;
    }
}

@media (min-width: 1024px) {
    .calendar-widget {
        display: none;
    }
    
    .main-calendar {
        grid-template-columns: 1fr 350px;
    }
    
    .calendar-sidebar {
        flex-direction: column;
    }
    
    body::-webkit-scrollbar {
        display: none;
    }
    
    .events-list-container,
    .upcoming-events-list,
    .news-list,
    .modal-content,
    .day-modal-content {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
}

@media (max-width: 480px) {
    .calendar-header {
        padding: 1.25rem 0.75rem;
    }

    .calendar-title {
        font-size: 1.6rem;
    }

    .calendar-subtitle {
        font-size: 1rem;
    }

    .calendar-widget {
        padding: 1.25rem 0.75rem;
    }

    .widget-month {
        font-size: 1.1rem;
    }

    .calendar-days .calendar-day {
        font-size: 0.75rem;
        min-height: 30px;
        border-radius: 6px;
    }

    .calendar-days .calendar-day:hover {
        transform: scale(1.03);
    }

    .calendar-days .calendar-day .event-dots-container {
        bottom: 3px;
        gap: 1px;
    }

    .calendar-days .calendar-day .event-dot {
        width: 4px;
        height: 4px;
    }

    .nav-btn {
        padding: 0.4rem 0.6rem;
        min-width: 36px;
        min-height: 36px;
        font-size: 14px;
    }

    .upcoming-event-card {
        padding: 1rem;
    }

    .upcoming-event-card h4 {
        font-size: 1rem;
    }

    .modal-content,
    .day-modal-content {
        margin: 0 auto;
        padding: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }
    
    .modal-header,
    .day-modal-header {
        padding: 1.25rem 0.75rem 0.75rem;
    }
    
    .modal-body,
    .day-modal-body {
        padding: 1.25rem 0.75rem;
    }

    .modal-content h3,
    .day-modal-title {
        font-size: 1.2rem;
    }
    
    .view-btn {
        padding: 0.5rem;
        min-width: 40px;
    }
    
    .today-btn, .refresh-btn {
        min-width: 120px;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .calendar-title {
        font-size: 1.4rem;
    }
    
    .current-month, .widget-month {
        font-size: 1.1rem;
    }
    
    .calendar-days .calendar-day {
        font-size: 0.7rem;
        min-height: 28px;
    }
    
    .today-btn, .refresh-btn {
        min-width: 100px;
        font-size: 0.85rem;
    }
    
    .view-btn {
        min-width: 36px;
    }
    
    .filter-select {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }
}

@media (min-width: 1400px) {
    .calendar-container {
        max-width: 1400px;
    }
}

* {
    max-width: 100%;
}

::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}