/* ==============================================
   MEC FULL CALENDAR — RealtyLine Theme
   ============================================== */

:root {
    --mec-primary: #021f59;
    --mec-primary-dark: #011641;
    --mec-accent1: #ff6b6b;
    --mec-accent2: #ffd166;
    --mec-accent3: #06d6a0;
    --mec-accent4: #118ab2;
    --mec-accent5: #7b68ee;
    --mec-accent6: #e77f67;
    --mec-text-dark: #000;
    --mec-text-mid: #626262;
    --mec-text-light: #999;
    --mec-border: #e9e9e9;
    --mec-bg-light: #f8f8f8;
    --mec-white: #ffffff;
}

/* Wrapper */
.mec-calendar-wrap {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--mec-white);
    border: 1px solid var(--mec-border);
    -webkit-font-smoothing: antialiased;
}

.mec-calendar-wrap *, .mec-calendar-wrap *::before, .mec-calendar-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ==============================================
   HEADER
   ============================================== */
.mec-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid var(--mec-border);
    flex-wrap: wrap;
    gap: 12px;
}

.mec-cal-header-left {
    display: flex;
    align-items: center;
}

.mec-cal-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mec-cal-month-year {
    font-size: 24px;
    font-weight: 700;
    color: var(--mec-text-dark);
    white-space: nowrap;
    min-width: 220px;
    text-align: center;
}

.mec-cal-nav-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--mec-border);
    background: var(--mec-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mec-text-mid);
    font-size: 14px;
    transition: all 0.2s;
    border-radius: 0;
}

.mec-cal-nav-btn:hover {
    background: var(--mec-primary);
    color: #fff;
    border-color: var(--mec-primary);
}

.mec-cal-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* View Tabs */
.mec-cal-view-tabs {
    display: flex;
    border: 1px solid var(--mec-border);
    overflow: hidden;
}

.mec-cal-tab {
    padding: 8px 20px;
    border: none;
    background: var(--mec-white);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--mec-text-mid);
    transition: all 0.2s;
    font-family: inherit;
    border-right: 1px solid var(--mec-border);
}

.mec-cal-tab:last-child { border-right: none; }

.mec-cal-tab:hover { background: var(--mec-bg-light); }

.mec-cal-tab.active {
    background: var(--mec-primary);
    color: #fff;
}

/* Today Button */
.mec-cal-today-btn {
    padding: 8px 20px;
    border: 1px solid var(--mec-border);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: var(--mec-white);
    color: var(--mec-text-mid);
    transition: all 0.2s;
    font-family: inherit;
}

.mec-cal-today-btn:hover {
    background: var(--mec-primary);
    color: #fff;
    border-color: var(--mec-primary);
}

/* ==============================================
   BODY
   ============================================== */
.mec-cal-body { padding: 0; }
.mec-hidden { display: none !important; }

/* Grid + Sidebar flex layout */
.mec-cal-layout {
    display: flex;
    min-height: 520px;
}

.mec-cal-main {
    flex: 1;
    min-width: 0;
}

/* Weekday Headers */
.mec-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--mec-border);
}

.mec-cal-weekdays > div {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--mec-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 0;
    background: var(--mec-bg-light);
}

/* Calendar Grid */
.mec-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

/* ==============================================
   DAY CELLS — Centered date + dot only
   ============================================== */
.mec-cal-cell {
    min-height: 90px;
    padding: 8px 4px;
    border-bottom: 1px solid var(--mec-border);
    border-right: 1px solid var(--mec-border);
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

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

.mec-cal-cell:hover { background: #fafafa; }

.mec-cal-cell.inactive {
    background: #fcfcfc;
    opacity: 0.4;
    cursor: default;
}

.mec-cal-cell.selected { background: #fff7f7; }

/* Day Number — centered */
.mec-cal-day-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: all 0.15s;
}

.mec-cal-cell:hover .mec-cal-day-num {
    background: var(--mec-primary);
    color: #fff;
}

.mec-cal-cell.today .mec-cal-day-num {
    background: var(--mec-primary);
    color: #fff;
    font-weight: 700;
}

.mec-cal-cell.selected .mec-cal-day-num {
    background: var(--mec-primary-dark);
    color: #fff;
    box-shadow: 0 2px 8px rgba(2, 31, 89, 0.3);
}

/* Event Dots — centered below day number */
.mec-cal-dots {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
    min-height: 8px;
}

.mec-cal-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    transition: transform 0.15s;
}

.mec-cal-cell:hover .mec-cal-dot {
    transform: scale(1.3);
}

.mec-cal-dot-more {
    font-size: 9px;
    font-weight: 700;
    color: var(--mec-text-light);
}

/* ==============================================
   SIDEBAR
   ============================================== */
.mec-cal-sidebar {
    width: 340px;
    border-left: 1px solid var(--mec-border);
    display: flex;
    flex-direction: column;
    background: var(--mec-bg-light);
    flex-shrink: 0;
}

.mec-cal-sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--mec-border);
    color: var(--mec-text-dark);
}

.mec-cal-sidebar-header i {
    color: var(--mec-primary);
    font-size: 15px;
}

.mec-cal-sidebar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--mec-text-dark);
}

.mec-cal-sidebar-events {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Event Card in Sidebar */
.mec-cal-event-card {
    background: var(--mec-white);
    border-radius: 3px;
    padding: 14px 16px;
    border-left: 4px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    display: block;
    animation: mecSlideIn 0.3s ease backwards;
}

.mec-cal-event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-decoration: none;
}

.mec-cal-event-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.mec-cal-event-card-content {
    flex: 1;
    min-width: 0;
}

.mec-cal-event-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--mec-text-dark);
    margin-bottom: 6px;
    line-height: 1.3;
}

.mec-cal-event-card-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.mec-cal-event-card-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--mec-text-mid);
}

.mec-cal-event-card-meta-item i {
    width: 14px;
    text-align: center;
    font-size: 11px;
    color: var(--mec-text-light);
}

/* Date badge in sidebar card */
.mec-cal-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.mec-cal-date-badge-day {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.mec-cal-date-badge-month {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* No events */
.mec-cal-no-events {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--mec-text-light);
    font-size: 14px;
    text-align: center;
}

/* More Events button */
.mec-cal-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    margin-top: 4px;
    background: transparent;
    border: 1px dashed var(--mec-border);
    color: var(--mec-primary);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.mec-cal-more-btn:hover {
    background: var(--mec-primary);
    color: #fff;
    border-style: solid;
    border-color: var(--mec-primary);
}

.mec-cal-more-btn i {
    font-size: 11px;
}

/* Sidebar scrollbar */
.mec-cal-sidebar-events::-webkit-scrollbar { width: 5px; }
.mec-cal-sidebar-events::-webkit-scrollbar-track { background: transparent; }
.mec-cal-sidebar-events::-webkit-scrollbar-thumb { background: #d0d8db; border-radius: 10px; }

/* ==============================================
   LIST VIEW
   ============================================== */
.mec-cal-list-view {
    padding: 0;
}

.mec-cal-list-card {
    display: flex;
    border-bottom: 1px solid var(--mec-border);
    text-decoration: none;
    transition: background 0.15s;
}

.mec-cal-list-card:hover { background: #fafafa; text-decoration: none; }

.mec-cal-list-date-block {
    width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    color: #fff;
    flex-shrink: 0;
}

.mec-cal-list-date-day {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.mec-cal-list-date-month {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 3px;
}

.mec-cal-list-date-weekday {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.85;
    margin-top: 2px;
}

.mec-cal-list-content {
    flex: 1;
    padding: 20px 25px;
    min-width: 0;
}

.mec-cal-list-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--mec-text-dark);
    margin-bottom: 6px;
}

.mec-cal-list-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.mec-cal-list-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--mec-text-mid);
}

.mec-cal-list-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 2px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ==============================================
   FOOTER
   ============================================== */
.mec-cal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 25px;
    border-top: 1px solid var(--mec-border);
    flex-wrap: wrap;
    gap: 8px;
}

.mec-cal-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.mec-cal-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--mec-text-mid);
    font-weight: 500;
}

.mec-cal-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mec-cal-count {
    font-size: 12px;
    color: var(--mec-text-light);
}

/* ==============================================
   ANIMATIONS
   ============================================== */
@keyframes mecFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes mecSlideIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 900px) {
    .mec-cal-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .mec-cal-layout {
        flex-direction: column;
    }

    .mec-cal-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--mec-border);
        max-height: 400px;
    }

    .mec-cal-cell {
        min-height: 70px;
        padding: 6px 2px;
    }

    .mec-cal-list-card { flex-direction: column; }
    .mec-cal-list-date-block { width: 100%; flex-direction: row; gap: 8px; padding: 10px 16px; }
    .mec-cal-list-date-day { font-size: 20px; }
}

@media (max-width: 600px) {
    .mec-calendar-wrap { border-left: none; border-right: none; }

    .mec-cal-month-year { font-size: 18px; min-width: auto; }

    .mec-cal-weekdays > div { font-size: 10px; letter-spacing: 0; padding: 8px 0; }

    .mec-cal-cell {
        min-height: 56px;
        padding: 4px 2px;
    }

    .mec-cal-day-num { width: 26px; height: 26px; font-size: 12px; }

    .mec-cal-dot { width: 5px; height: 5px; }
    .mec-cal-dots { gap: 3px; margin-top: 4px; }
}
