/* Modern Calendar Styling & Fixes */

/* ============================================
   ADD EVENT BUTTON FIX
   ============================================ */

button[data-action="new-event-button"] {
    background: linear-gradient(135deg, rgb(52, 152, 219) 0%, rgb(41, 128, 185) 100%) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 12px 24px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3) !important;
    position: relative !important;
    overflow: hidden !important;
}

button[data-action="new-event-button"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.4) !important;
}

button[data-action="new-event-button"]:active {
    transform: translateY(0) !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3) !important;
}

button[data-action="new-event-button"] i {
    margin-right: 8px !important;
}

/* ============================================
   CALENDAR TABLE STYLING
   ============================================ */

.calendartable {
    width: 100% !important;
    border-collapse: collapse !important;
}

.calendartable td {
    position: relative !important;
    padding: 10px !important;
    border: 1px solid #e8e8e8 !important;
    vertical-align: top !important;
}

.calendartable td:hover {
    background: rgba(52, 152, 219, 0.05) !important;
    cursor: pointer !important;
}

/* ============================================
   DAY CELLS
   ============================================ */

.calendartable td.day {
    min-height: 100px !important;
    background: white !important;
    transition: all 0.2s ease !important;
}

.calendartable td.today {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(41, 128, 185, 0.1) 100%) !important;
}

.calendartable td.today .day-number {
    color: rgb(52, 152, 219) !important;
    font-weight: 700 !important;
}

.calendartable td.day:hover {
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15) !important;
    border-color: rgb(52, 152, 219) !important;
}

/* ============================================
   DAY NUMBER
   ============================================ */

.day-number-circle {
    background: white !important;
    border-radius: 50% !important;
    width: 35px !important;
    height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    color: rgb(52, 73, 94) !important;
    margin-bottom: 10px !important;
}

.calendartable td.today .day-number-circle {
    background: linear-gradient(135deg, rgb(52, 152, 219) 0%, rgb(41, 128, 185) 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3) !important;
}

/* ============================================
   CALENDAR EVENTS
   ============================================ */

[data-region="day-content"] ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 10px 0 0 0 !important;
}

[data-region="day-content"] li {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(46, 204, 113, 0.05) 100%) !important;
    border-left: 3px solid rgb(52, 152, 219) !important;
    padding: 6px 10px !important;
    margin-bottom: 4px !important;
    border-radius: 4px !important;
    font-size: 0.85rem !important;
    color: rgb(52, 73, 94) !important;
    transition: all 0.2s ease !important;
}

[data-region="day-content"] li:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(46, 204, 113, 0.1) 100%) !important;
    border-left-color: rgb(41, 128, 185) !important;
}

[data-region="event-item"] a {
    color: rgb(52, 73, 94) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
}

[data-region="event-item"] a:hover {
    color: rgb(52, 152, 219) !important;
    text-decoration: underline !important;
}

/* ============================================
   CALENDAR CONTROLS
   ============================================ */

.calendar-controls {
    padding: 20px !important;
    background: white !important;
    border-radius: 8px !important;
    margin-bottom: 20px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.calendar-controls button,
.calendar-controls a {
    padding: 10px 20px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}

/* ============================================
   MODAL FOR NEW EVENT
   ============================================ */

.modal-header {
    background: linear-gradient(135deg, rgb(52, 152, 219) 0%, rgb(41, 128, 185) 100%) !important;
    border: none !important;
    color: white !important;
}

.modal-header h5,
.modal-header .modal-title {
    color: white !important;
    font-weight: 700 !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .calendartable {
        font-size: 0.85rem !important;
    }

    .calendartable td {
        padding: 8px !important;
        min-height: 80px !important;
    }

    [data-region="day-content"] li {
        font-size: 0.75rem !important;
        padding: 4px 8px !important;
    }

    button[data-action="new-event-button"] {
        width: 100% !important;
        margin-top: 10px !important;
    }
}

/* ============================================
   DARK MODE
   ============================================ */

@media (prefers-color-scheme: dark) {
    [data-bs-theme=auto] {
        .calendartable {
            background: #1a1a1a !important;
        }

        .calendartable td {
            background: #2a2a2a !important;
            border-color: #444 !important;
            color: #ecf0f1 !important;
        }

        .calendartable td:hover {
            background: rgba(52, 152, 219, 0.15) !important;
        }

        .calendartable td.today {
            background: linear-gradient(135deg, rgba(52, 152, 219, 0.2) 0%, rgba(41, 128, 185, 0.2) 100%) !important;
        }

        .day-number-circle {
            background: #3a3a3a !important;
            color: #ecf0f1 !important;
        }

        [data-region="day-content"] li {
            background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(46, 204, 113, 0.05) 100%) !important;
            color: #ecf0f1 !important;
        }

        [data-region="event-item"] a {
            color: #ecf0f1 !important;
        }

        .calendar-controls {
            background: #2a2a2a !important;
            color: #ecf0f1 !important;
        }
    }
}

[data-bs-theme=dark] {
    .calendartable {
        background: #1a1a1a !important;
    }

    .calendartable td {
        background: #2a2a2a !important;
        border-color: #444 !important;
        color: #ecf0f1 !important;
    }

    .calendartable td:hover {
        background: rgba(52, 152, 219, 0.15) !important;
    }

    .calendartable td.today {
        background: linear-gradient(135deg, rgba(52, 152, 219, 0.2) 0%, rgba(41, 128, 185, 0.2) 100%) !important;
    }

    .day-number-circle {
        background: #3a3a3a !important;
        color: #ecf0f1 !important;
    }

    [data-region="day-content"] li {
        background: linear-gradient(135deg, rgba(52, 152, 219, 0.15) 0%, rgba(46, 204, 113, 0.05) 100%) !important;
        color: #ecf0f1 !important;
    }

    [data-region="event-item"] a {
        color: #ecf0f1 !important;
    }

    .calendar-controls {
        background: #2a2a2a !important;
        color: #ecf0f1 !important;
    }
}
