/**
 * UltraAddons Event Calendar Widget Stylesheet
 * 
 * @package UltraAddons
 * @version 1.0.0
 */

/* Container */
.ua-event-calendar {
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
    color: #1e293b;
    background-color: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    padding: 24px;
    position: relative;
}

.ua-event-calendar * {
    box-sizing: border-box;
}

/*--------------------------------------------------------------
 == 1. Filter & Search Top Bar
 --------------------------------------------------------------*/
.ua-calendar-top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.ua-calendar-categories-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ua-cal-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    background-color: #f1f5f9;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1.4;
}

.ua-cal-cat-btn:hover {
    background-color: #e2e8f0;
    color: #334155;
}

.ua-cal-cat-btn.ua-active {
    background-color: #4a2db6;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(74, 45, 182, 0.25);
}

.ua-calendar-search-box {
    position: relative;
    min-width: 220px;
}

.ua-calendar-search-input {
    width: 100%;
    padding: 8px 36px 8px 14px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    font-size: 13px;
    color: #334155;
    outline: none;
    transition: all 0.2s ease;
}

.ua-calendar-search-input:focus {
    border-color: #4a2db6;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(74, 45, 182, 0.12);
}

.ua-calendar-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 13px;
}

/*--------------------------------------------------------------
 == 2. Calendar Header & Navigation
 --------------------------------------------------------------*/
.ua-calendar-header {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
    width: 100%;
}

.ua-calendar-nav {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.ua-cal-btn-group {
    display: inline-flex;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    background-color: #ffffff;
    width: 100%;
}

.ua-cal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background-color: #ffffff;
    border: none;
    color: #475569;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1;
    flex: 1;
}

.ua-cal-btn svg {
    display: block;
    width: 13px;
    height: 13px;
}

.ua-cal-btn:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.ua-cal-btn-prev {
    border-right: 1px solid #e2e8f0;
}

.ua-cal-btn-today {
    display: block;
    width: 100%;
    text-align: center;
    border: 1px solid #e2e8f0 !important;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    padding: 4px 10px;
    background-color: #ffffff;
    cursor: pointer;
    line-height: 1.3;
}

.ua-cal-btn-today:hover {
    background-color: #f8fafc;
    color: #0f172a;
}

.ua-calendar-title {
    flex-grow: 1;
    margin: 0;
    line-height: 1.2;
    text-align: center;
}

.ua-calendar-title .ua-title-month {
    display: inline-block;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.2px;
}

.ua-calendar-views {
    display: inline-flex;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    background-color: #ffffff;
}

.ua-view-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    border: none;
    border-right: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.ua-view-btn:last-child {
    border-right: none;
}

.ua-view-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ua-view-btn-icon svg {
    display: block;
    width: 14px;
    height: 14px;
}

.ua-view-btn-text {
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.ua-view-btn:hover {
    color: #1e293b;
    background-color: #f8fafc;
}

.ua-view-btn.ua-active {
    background-color: #4a2db6 !important;
    color: #ffffff !important;
}

.ua-view-btn.ua-active .ua-view-btn-icon,
.ua-view-btn.ua-active .ua-view-btn-icon svg {
    color: #ffffff !important;
    stroke: #ffffff;
    fill: #ffffff;
}

/*--------------------------------------------------------------
 == 3. Month View Grid
 --------------------------------------------------------------*/
.ua-calendar-month-view {
    width: 100%;
}

.ua-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    width: 100%;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    overflow: hidden;
}

.ua-cal-weekday {
    padding: 10px 4px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    text-transform: capitalize;
    border-right: 1px solid #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ua-cal-weekday:last-child {
    border-right: none;
}

.ua-calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    width: 100%;
    border: 1px solid #e2e8f0;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    overflow: hidden;
}

.ua-cal-day-cell {
    min-height: 100px;
    padding: 6px 6px 8px;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    background-color: #ffffff;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.2s ease;
}

.ua-cal-day-cell:nth-child(7n) {
    border-right: none;
}

.ua-cal-day-cell:hover {
    background-color: #fafbfc;
}

.ua-cal-day-other-month {
    background-color: #f8fafc;
    opacity: 0.45;
}

.ua-cal-day-today {
    background-color: #fff9db !important;
}

.ua-cal-day-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.ua-cal-day-num {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    text-align: center;
}

.ua-cal-day-today .ua-cal-day-num {
    color: #1e293b;
    font-weight: 800;
    font-size: 15px;
}

.ua-cal-day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow: hidden;
    width: 100%;
}

/* Event Pill */
.ua-event-pill {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 3px 6px;
    border-radius: 4px;
    color: #ffffff;
    background-color: #4a2db6;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.15s ease;
    user-select: none;
    line-height: 1.3;
    text-align: center;
}

.ua-event-pill:hover {
    opacity: 0.9;
}

.ua-event-pill-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    color: inherit;
}

.ua-event-more-btn {
    font-size: 11px;
    font-weight: 600;
    color: #4a2db6;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: center;
    padding: 2px 4px;
}

/*--------------------------------------------------------------
 == 4. TimeGrid View (Day & Week Layout)
 --------------------------------------------------------------*/
.ua-timegrid-view {
    width: 100%;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
}

.ua-timegrid-header-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.ua-timegrid-header-table thead th {
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.ua-timegrid-axis-cell {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    border-right: 1px solid #e2e8f0;
}

.ua-timegrid-col-header {
    border-right: 1px solid #e2e8f0;
}

.ua-timegrid-col-header:last-child {
    border-right: none;
}

.ua-timegrid-col-header.ua-today-col {
    background: #fff9db !important;
}

.ua-week-hdr-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

/* All-day row */
.ua-timegrid-allday-row {
    display: flex;
    width: 100%;
    border-bottom: 2px solid #e2e8f0;
    background: #ffffff;
}

.ua-timegrid-allday-label {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    padding: 8px 6px;
    font-size: 11px;
    color: #64748b;
    text-align: right;
    border-right: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: #f8fafc;
}

.ua-timegrid-allday-content {
    flex: 1;
    padding: 6px 10px;
    min-height: 40px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.ua-timegrid-allday-cols {
    display: flex;
    flex: 1;
}

.ua-timegrid-allday-cell {
    flex: 1;
    padding: 6px 6px;
    min-height: 40px;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ua-timegrid-allday-cell:last-child {
    border-right: none;
}

.ua-today-cell {
    background-color: #fff9db !important;
}

/* Scrollable TimeGrid Body */
.ua-timegrid-scroll-body {
    max-height: 480px;
    overflow-y: auto;
    position: relative;
}

.ua-timegrid-body-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.ua-timegrid-hour-row {
    height: 40px;
}

.ua-timegrid-time-label {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    padding: 0 8px 0 0;
    text-align: right;
    font-size: 11px;
    color: #64748b;
    vertical-align: top;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.ua-timegrid-time-label span {
    position: relative;
    top: -7px;
    display: inline-block;
}

.ua-timegrid-slot-cell {
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #f1f5f9;
    padding: 2px 4px;
    vertical-align: top;
    position: relative;
}

.ua-timegrid-slot-cell:last-child {
    border-right: none;
}

/* TimeGrid Event Block */
.ua-timegrid-event {
    background-color: #4a2db6;
    color: #ffffff;
    border-radius: 4px;
    padding: 4px 8px;
    margin-bottom: 2px;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.ua-timegrid-event:hover {
    opacity: 0.9;
}

.ua-timegrid-event-title {
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    color: inherit;
    line-height: 1.3;
}

.ua-timegrid-event-loc {
    font-size: 10px;
    opacity: 0.9;
    margin-top: 2px;
}

/*--------------------------------------------------------------
 == 5. List / Agenda View
 --------------------------------------------------------------*/
.ua-calendar-list-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ua-cal-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    gap: 16px;
}

.ua-cal-list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1;
}

.ua-cal-list-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-grow: 1;
}

.ua-cal-list-date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 6px 8px;
    border-radius: 6px;
    background-color: #f1f5f9;
    color: #334155;
    text-align: center;
}

.ua-cal-list-month {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.ua-cal-list-day {
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    margin-top: 2px;
}

.ua-cal-list-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ua-cal-list-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.ua-cal-list-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #64748b;
}

.ua-cal-list-cat-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    background-color: #4a2db6;
}

.ua-cal-list-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background-color: #4a2db6;
    color: #ffffff !important;
    text-decoration: none !important;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.ua-calendar-no-events {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
}

/*--------------------------------------------------------------
 == 6. Table Layout View
 --------------------------------------------------------------*/
.ua-event-calendar.ua-layout-table {
    padding: 20px;
}

.ua-table-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    justify-content: flex-end;
}

.ua-table-search-label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.ua-table-search-input {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #334155;
    outline: none;
    width: 200px;
    transition: all 0.2s ease;
}

.ua-table-search-input:focus {
    border-color: #4a2db6;
    box-shadow: 0 0 0 3px rgba(74, 45, 182, 0.12);
}

.ua-table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.ua-event-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.ua-event-table th {
    padding: 12px 14px;
    background: #f8fafc;
    color: #1e293b;
    font-weight: 700;
    font-size: 13px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.ua-event-table td {
    padding: 12px 14px;
    font-size: 13px;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.ua-event-table tr:last-child td {
    border-bottom: none;
}

.ua-event-table tr:hover td {
    background-color: #f8fafc;
}

.ua-event-row-title {
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
}

.ua-event-row-title:hover {
    color: #4a2db6;
}

.ua-table-details-btn {
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ua-table-details-btn:hover {
    background: #4a2db6;
    border-color: #4a2db6;
    color: #ffffff;
}

.ua-table-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    justify-content: flex-end;
}

.ua-table-page-btn {
    padding: 6px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #ffffff;
    color: #475569;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ua-table-page-btn:hover,
.ua-table-page-btn.ua-active {
    background: #4a2db6;
    border-color: #4a2db6;
    color: #ffffff;
}

/*--------------------------------------------------------------
 == 7. Event Detail Modal Popup
 --------------------------------------------------------------*/
.ua-event-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.ua-event-modal.ua-open {
    opacity: 1;
    visibility: visible;
}

.ua-event-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

.ua-event-modal-dialog {
    position: relative;
    z-index: 2;
    background-color: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ua-event-modal.ua-open .ua-event-modal-dialog {
    transform: scale(1);
}

.ua-event-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(15, 23, 42, 0.5);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.ua-event-modal-close:hover {
    background-color: rgba(15, 23, 42, 0.85);
}

.ua-event-modal-banner {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.ua-event-modal-body {
    padding: 20px 24px 24px;
}

.ua-event-modal-category {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    background-color: #10ecab;
    margin-bottom: 10px;
}

.ua-event-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 14px;
    line-height: 1.3;
}

.ua-event-modal-meta-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    padding: 12px;
    background-color: #f8fafc;
    border-radius: 8px;
}

.ua-event-modal-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #475569;
}

.ua-event-modal-desc {
    font-size: 13px;
    line-height: 1.6;
    color: #475569;
    margin: 0 0 20px;
}

.ua-event-modal-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 20px;
    background-color: #4a2db6;
    color: #ffffff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.ua-event-modal-btn:hover {
    background-color: #3b2296;
}

/*--------------------------------------------------------------
 == 8. Responsive Breakpoints
 --------------------------------------------------------------*/
@media (max-width: 767px) {
    .ua-event-calendar {
        padding: 14px;
    }
    .ua-calendar-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .ua-calendar-title {
        text-align: center;
    }
    .ua-calendar-views {
        width: 100%;
        justify-content: center;
    }
    .ua-cal-weekday {
        font-size: 11px;
        padding: 6px 2px;
    }
    .ua-cal-day-cell {
        min-height: 70px;
        padding: 4px 2px;
    }
    .ua-event-pill {
        font-size: 10px;
        padding: 2px 4px;
    }
}
