/**
 * Sympla Event Showcase - Dark Agro-Tech Premium Styles
 * Version: 1.0.0
 * Customized for Fórum Bioinsumos no Agro
 */

/* Container & Variables Setup */
.sympla-showcase-container {
    --sympla-primary: #00e676;
    --sympla-primary-hover: #00ff80;
    --sympla-primary-glow: rgba(0, 230, 118, 0.4);
    
    --sympla-bg-card: rgba(12, 26, 19, 0.6);
    --sympla-border-glass: rgba(0, 230, 118, 0.15);
    --sympla-border-hover: rgba(0, 230, 118, 0.4);
    
    --sympla-text-main: #ffffff;
    --sympla-text-muted: #8899a6;
    --sympla-bg-overlay: rgba(3, 7, 5, 0.85);
    --sympla-bg-modal: rgba(12, 26, 19, 0.95);
    
    --sympla-font-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --sympla-font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    width: 100%;
    margin: 2rem 0;
    box-sizing: border-box;
    font-family: var(--sympla-font-body);
}

.sympla-showcase-grid {
    display: grid;
    gap: 24px;
    width: 100%;
}

/* Responsive Columns */
.sympla-cols-1 { grid-template-columns: 1fr; }
.sympla-cols-2 { grid-template-columns: repeat(2, 1fr); }
.sympla-cols-3 { grid-template-columns: repeat(3, 1fr); }
.sympla-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Auto-expand grid if only one event card is present (common for single-event sites) */
.sympla-showcase-grid:has(> :only-child) {
    grid-template-columns: 1fr !important;
}

@media (max-width: 1024px) {
    .sympla-showcase-grid.sympla-cols-4,
    .sympla-showcase-grid.sympla-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .sympla-showcase-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Card Design (Glassmorphic Dark Mode) */
.sympla-event-card {
    background: var(--sympla-bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--sympla-border-glass);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), 
                box-shadow 0.3s ease, 
                border-color 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    box-sizing: border-box;
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
}

.sympla-event-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 230, 118, 0.12);
    border-color: var(--sympla-border-hover);
}

/* Banner Image */
.sympla-event-banner {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    background-color: #0c1a13;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.sympla-event-banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.6) 100%);
    transition: opacity 0.3s ease;
    opacity: 0.8;
}

.sympla-event-card:hover .sympla-event-banner::after {
    opacity: 1;
}

/* Badges */
.sympla-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--sympla-primary);
    color: #030805;
    padding: 6px 14px;
    font-size: 11px;
    font-family: var(--sympla-font-title);
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 230, 118, 0.3);
}

.sympla-badge-ended {
    background: rgba(239, 68, 68, 0.9);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Card Body */
.sympla-event-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    box-sizing: border-box;
}

.sympla-event-title {
    margin: 0 0 15px 0;
    font-family: var(--sympla-font-title);
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.25;
    color: #ffffff;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: auto;
    min-height: 54px;
}

.sympla-event-card:hover .sympla-event-title {
    color: var(--sympla-primary);
}

/* Metadata */
.sympla-event-meta {
    font-size: 13.5px;
    color: var(--sympla-text-muted);
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 15px;
}

.sympla-meta-item {
    display: flex;
    align-items: center;
    line-height: 1.5;
}

.sympla-meta-date strong {
    color: var(--sympla-text-main);
}

/* Description snippet */
.sympla-event-description {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--sympla-text-muted);
    margin: 0 0 24px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* Footer / Button */
.sympla-event-footer {
    margin-top: auto;
}

.sympla-button {
    display: block;
    width: 100%;
    padding: 14px 20px;
    text-align: center;
    background: var(--sympla-primary);
    color: #030805 !important;
    font-family: var(--sympla-font-title);
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none !important;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    box-shadow: 0 4px 15px var(--sympla-primary-glow);
}

.sympla-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 230, 118, 0.5);
    background: var(--sympla-primary-hover);
    color: #030805 !important;
}

.sympla-button:active {
    transform: translateY(0);
}

/* Errors & Empty States */
.sympla-showcase-error,
.sympla-showcase-empty {
    padding: 24px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    color: var(--sympla-text-muted);
    text-align: center;
    font-size: 15px;
}

.sympla-showcase-error {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
    color: #ef4444;
}

/* Modal Popup Styles (Centered & Dark Theme) */
.sympla-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    box-sizing: border-box;
}

.sympla-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--sympla-bg-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}

.sympla-modal-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 90%;
    max-width: 860px;
    height: 85%;
    max-height: 700px;
    background: var(--sympla-bg-modal);
    border: 1px solid var(--sympla-border-glass);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 230, 118, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

/* Modal Header */
.sympla-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(12, 26, 19, 0.5);
}

.sympla-modal-title {
    margin: 0;
    font-family: var(--sympla-font-title);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.sympla-modal-close {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1.4rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--sympla-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.2s ease;
    line-height: 1;
}

.sympla-modal-close:hover {
    background: rgba(255, 82, 82, 0.1);
    color: #ff5252;
    border-color: rgba(255, 82, 82, 0.2);
}

/* Modal Body */
.sympla-modal-body {
    flex-grow: 1;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.sympla-modal-iframe-container {
    width: 100%;
    height: 100%;
    border: none;
}

.sympla-modal-iframe-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Loader Spinner */
.sympla-modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--sympla-bg-modal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.sympla-modal-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.sympla-spinner {
    width: 45px;
    height: 45px;
    border: 3px solid rgba(0, 230, 118, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--sympla-primary);
    animation: symplaSpin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes symplaSpin {
    to { transform: rotate(360deg); }
}

.sympla-modal-loading p {
    margin: 0;
    font-size: 14.5px;
    color: var(--sympla-text-muted);
    font-weight: 600;
}
