/**
 * ACS Agenda Manager - Frontend Styles
 *
 * @package ACSAgendaManager
 */

/* ==========================================================================
   Agenda Container
   ========================================================================== */

.container-agenda {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.acs-agenda-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ==========================================================================
   Event Card
   ========================================================================== */

.acsagenda {
    background: #fff;
    border-radius: var(--acs-border-radius);
    border: 1px solid var(--acs-border-color);
    margin-bottom: 1.5rem;
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 0;
    overflow: hidden;
    box-shadow: var(--acs-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.acsagenda:hover {
    transform: translateY(-2px);
    box-shadow: var(--acs-shadow-lg);
}

.acsAgenda {
    position: relative;
    z-index: 1;
    padding: 1rem;
    background: #fff;
    color: var(--acs-text-color);
    border: none;
}

/* ==========================================================================
   Category Badge
   ========================================================================== */

.event-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.category-badge {
    background: var(--acs-accent-color);
    color: #fff;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}

.status-badge {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    animation: pulse 2s ease-in-out infinite;
}

.status-today {
    background: var(--acs-danger-color);
    color: #fff;
}

.status-running {
    background: var(--acs-warning-color);
    color: #744210;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Legacy support */
.acsAgenda-title {
    display: none;
}

/* ==========================================================================
   Columns Layout
   ========================================================================== */

.column-left {
    background: linear-gradient(135deg, var(--acs-primary-color) 0%, var(--acs-secondary-color) 100%);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    min-height: 160px;
}

.column-left .acsAgenda-title {
    display: none;
}

.column-center {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.column-center .acsAgenda-title {
    width: fit-content;
}

/* Event Title */
.event-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--acs-primary-color);
    line-height: 1.3;
}

.column-center h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--acs-text-color);
}

/* Event Intro */
.event-intro {
    flex: 1;
}

.event-intro p {
    color: var(--acs-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

.column-right {
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--acs-bg-light) 0%, #edf2f7 100%);
    min-width: 180px;
    position: relative;
    overflow: hidden;
}

.column-left-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Date Display
   ========================================================================== */

.ACSdate {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.5rem;
    min-width: 50px;
    text-align: center;
}

.ACSdate .month {
    display: block;
    color: var(--acs-accent-light);
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ACSdate .day {
    display: block;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.ACSdate .week {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.6rem;
    text-transform: uppercase;
}

.ACSyear {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    border-radius: 4px;
    padding: 0.25rem 0.75rem;
    margin-top: 0.5rem;
}

/* ==========================================================================
   Location & Description
   ========================================================================== */

.placement {
    text-align: center;
    margin-top: auto;
}

.placement h5 {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.placement .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.course-description.acsAgenda {
    padding: 0;
    border: none;
    background: transparent;
}

.course-description h5 {
    color: var(--acs-text-muted);
    font-size: 0.9rem;
    font-weight: 400;
    line-height: 1.6;
    margin: 0 0 1rem 0;
}

/* ==========================================================================
   Image
   ========================================================================== */

.image-agenda {
    width: 160px;
    height: 140px;
    object-fit: cover;
    border-radius: 10px;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.image-agenda:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.image-agenda:focus {
    outline: 3px solid var(--acs-accent-color);
    outline-offset: 2px;
}

/* Expand hint icon */
.image-expand-hint {
    position: absolute;
    bottom: 1.25rem;
    right: 1.25rem;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 1;
}

.image-expand-hint .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.column-right:hover .image-expand-hint {
    opacity: 1;
}

/* Image badge overlay */
.column-right::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: var(--acs-accent-color);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
    opacity: 0.8;
    pointer-events: none;
    z-index: 1;
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

#acs-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#acs-lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.acs-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-size: 32px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.acs-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    transform: rotate(90deg);
}

.acs-lightbox-close:focus {
    outline: 2px solid var(--acs-accent-color);
    outline-offset: 2px;
}

.acs-lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: lightbox-zoom-in 0.3s ease;
}

@keyframes lightbox-zoom-in {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

body.acs-lightbox-open {
    overflow: hidden;
}

/* ==========================================================================
   Read More Button
   ========================================================================== */

.readmore.show {
    background: transparent;
    border: 2px solid var(--acs-accent-color);
    color: var(--acs-accent-color);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: auto;
    margin-top: auto;
}

.readmore.show:hover {
    background: var(--acs-accent-color);
    color: #fff;
    transform: translateX(3px);
}

.readmore.show .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.readmore.show:hover .dashicons {
    transform: translateX(3px);
}

/* ==========================================================================
   Dialog (Frontend Event Details)
   ========================================================================== */

#dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
    background-color: #fff;
    z-index: 1;
    overflow-y: auto;
}

#dialog.shown {
    display: flex;
    flex-direction: column;
    z-index: 999999;
}

#close {
    position: sticky;
    top: 5px;
    left: 90%;
    height: 50px;
    width: 50px;
    z-index: 9999999999;
    background: #223445;
    color: #fff;
    display: block;
    font-size: 1.5em;
    padding: 0.5em;
    border: 1px solid #223445 !important;
    border-radius: 18px !important;
    cursor: pointer;
    transition: background 0.2s ease;
}

#close:hover {
    background: #000;
}

/* ==========================================================================
   Expired Events
   ========================================================================== */

.acsagendaexpired {
    opacity: 0.5;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 768px) {
    .acsagenda {
        grid-template-columns: 1fr;
    }

    .column-left {
        min-height: auto;
        padding: 1rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .column-left-container {
        margin-bottom: 0;
    }

    .placement {
        margin-top: 0;
    }

    .column-center {
        padding: 1.25rem;
    }

    .column-right {
        padding: 1.5rem;
        background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
        border-top: 1px solid var(--acs-border-color);
        min-width: auto;
    }

    .column-right::before {
        display: none;
    }

    .image-agenda {
        width: 100%;
        max-width: 300px;
        height: auto;
        max-height: 200px;
    }

    .ACSyear {
        margin-top: 0;
        margin-left: 1rem;
    }

    .event-header {
        justify-content: center;
    }

    .event-title {
        text-align: center;
    }

    .event-intro p {
        text-align: center;
    }

    .readmore.show {
        align-self: center;
    }
}

@media screen and (max-width: 480px) {
    .container-agenda {
        padding: 1rem 0.5rem;
    }

    .column-center h3,
    .event-title {
        font-size: 1.1rem;
    }

    .readmore.show {
        width: 100%;
        justify-content: center;
    }
}
