/* =====================================================
   EMS Frontend CSS
   Event cards, calendar, registration section
   ===================================================== */

/* --------------------------------------------------
   Calendar Wrapper
-------------------------------------------------- */
.ems-calendar-frontend-wrap {
    max-width: 100%;
    margin: 0 0 32px;
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.ems-calendar-frontend-wrap .fc {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.ems-calendar-frontend-wrap .fc-button {
    background: #1e3a5f !important;
    border-color: #1e3a5f !important;
}
.ems-calendar-frontend-wrap .fc-button:hover {
    background: #2d5490 !important;
}
.ems-calendar-frontend-wrap .fc-button-active,
.ems-calendar-frontend-wrap .fc-button:focus {
    background: #2d5490 !important;
    box-shadow: none !important;
}

/* --------------------------------------------------
   Registration Section (calendar + events together)
-------------------------------------------------- */
.ems-registration-section {
    max-width: 100%;
}
.ems-reg-calendar-wrap {
    margin-bottom: 40px;
}
.ems-reg-events-wrap {
    /* events grid sits below calendar */
}

/* --------------------------------------------------
   Events Grid
-------------------------------------------------- */
.ems-events-grid {
    display: grid;
    gap: 24px;
    margin: 0;
}
.ems-events-grid.ems-col-3 { grid-template-columns: repeat(3, 1fr); }
.ems-events-grid.ems-col-2 { grid-template-columns: repeat(2, 1fr); }
.ems-events-grid.ems-col-1 { grid-template-columns: 1fr; }
.ems-events-grid.ems-col-4 { grid-template-columns: repeat(4, 1fr); }

/* --------------------------------------------------
   Event Card
-------------------------------------------------- */
.ems-event-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,.08);
    transition: transform .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.ems-event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,.14);
}

/* Card Image */
.ems-card-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}
.ems-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.ems-event-card:hover .ems-card-image img {
    transform: scale(1.04);
}
.ems-card-placeholder {
    width: 100%;
    height: 100%;
}

/* Date Badge */
.ems-card-date-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(255,255,255,.92);
    color: #1e293b;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    max-width: calc(100% - 20px);
}

/* Status Badge */
.ems-card-status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.ems-status-badge-upcoming  { background: #fef3c7; color: #92400e; }
.ems-status-badge-running,
.ems-status-badge-ongoing   { background: #dcfce7; color: #15803d; }
.ems-status-badge-completed,
.ems-status-badge-closed    { background: #f1f5f9; color: #475569; }
.ems-status-badge-cancelled { background: #fee2e2; color: #b91c1c; }
.ems-status-badge-full{ background: #fee2e2; color: #b91c1c; }
/* Closed card — grayed out */
.ems-card-closed {
    opacity: 0.72;
    filter: grayscale(0.3);
}
.ems-card-closed .ems-card-image img {
    filter: grayscale(0.4);
}
.ems-btn-closed {
    background: #e2e8f0;
    color: #94a3b8;
    border: none;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 7px;
    cursor: not-allowed;
    display: inline-block;
    white-space: nowrap;
}

/* Card Body */
.ems-card-body {
    padding: 16px 18px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.ems-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px;
    line-height: 1.4;
}
.ems-card-title a {
    color: inherit;
    text-decoration: none;
}
.ems-card-title a:hover { color: #1e3a5f; }

/* Meta Icons */
.ems-card-meta {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 14px;
    flex: 1;
}
.ems-meta-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #64748b;
}
.ems-meta-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #94a3b8;
}

/* Card Footer */
.ems-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
    gap: 10px;
}
.ems-card-price {
    font-size: 14px;
    color: #1e293b;
}
.ems-free { color: #10b981; }

/* Register Now Button */
.ems-btn-register {
    background: #1e3a5f;
    color: #fff !important;
    border: none;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 7px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background .15s;
    display: inline-block;
}
.ems-btn-register:hover { background: #2d5490; }

/* --------------------------------------------------
   Archive Page Specific
-------------------------------------------------- */
.ems-archive-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}
.ems-archive-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 32px 0 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.ems-archive-title {
    font-size: 24px;
    font-weight: 800;
    color: #1e293b;
    margin: 0;
}
.ems-archive-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.ems-filter-btn {
    background: #f8fafc;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all .15s;
}
.ems-filter-btn:hover, .ems-filter-btn.active {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

/* Archive calendar section */
.ems-archive-calendar-section {
    margin-bottom: 32px;
}

/* No Events */
.ems-no-events {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 15px;
    grid-column: 1 / -1;
}

/* Pagination */
.ems-pagination {
    display: flex;
    justify-content: center;
    margin-top: 32px;
    gap: 8px;
}
.ems-pagination .page-numbers {
    padding: 8px 14px;
    border-radius: 7px;
    border: 1.5px solid #e2e8f0;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
}
.ems-pagination .page-numbers.current,
.ems-pagination .page-numbers:hover {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

/* --------------------------------------------------
   Responsive
-------------------------------------------------- */
@media (max-width: 1024px) {
    .titla_text{
        max-width: 100px !important;
    }
}

@media (max-width: 900px) {
    .ems-events-grid.ems-col-3,
    .ems-events-grid.ems-col-4 { grid-template-columns: repeat(2, 1fr); }
    .titla_dot{
        display: none !important;
    }
    .titla_text{
        max-width: 95px !important;
    }
}
@media (max-width: 600px) {
    .ems-events-grid.ems-col-2,
    .ems-events-grid.ems-col-3,
    .ems-events-grid.ems-col-4 { grid-template-columns: 1fr; }
    .ems-archive-header { flex-direction: column; align-items: flex-start; }
    .ems-card-footer { flex-direction: column; align-items: flex-start; }
    .ems-btn-register { width: 100%; text-align: center; }
    .titla_dot{
        display: none !important;
    }
    .titla_text{
        max-width: 40px !important;
    }
    .fc-toolbar-title{
        font-size: 16px !important;
    }
    .fc .fc-button{
        padding: 0.2em 0.30em;
    }
}

.comments-area a, .page-content a{
    text-decoration: none !important;
}
.fc-timegrid-event{
    min-height: 50px !important;
}