/* Frontend Styles - Event Schedule Grid */

.esg-schedule-grid-wrapper {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.esg-schedule-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.esg-schedule-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: #fff;
}

/* Permitir dimensões customizadas via atributos inline */
.esg-schedule-grid-wrapper[style*="width"] .esg-schedule-table-container,
.esg-schedule-grid-wrapper[style*="width"] .esg-schedule-table {
    width: 100% !important;
    max-width: 100%;
}

.esg-schedule-grid-wrapper[style*="height"] .esg-schedule-table-container {
    height: 100%;
}

/* Quando houver altura definida, permitir scroll vertical */
.esg-schedule-grid-wrapper[style*="max-height"] .esg-schedule-table-container {
    overflow-y: auto;
}

/* FORÇA MÁXIMA: Garantir que estilos inline sejam respeitados */
.esg-schedule-grid-wrapper[style] {
    display: block !important;
    box-sizing: border-box !important;
}

.esg-schedule-grid-wrapper[style] .esg-schedule-table-container {
    display: block !important;
    box-sizing: border-box !important;
}

/* Prevenir que temas sobrescrevam */
body .esg-schedule-grid-wrapper[style] {
    width: var(--esg-width, 100%) !important;
}

body .esg-schedule-grid-wrapper[style] .esg-schedule-table-container[style] {
    height: var(--esg-height, auto) !important;
    max-height: var(--esg-max-height, none) !important;
}

/* ESCAPAR DO CONTAINER PAI: Quando dimensões customizadas forem definidas */
.esg-schedule-grid-wrapper.esg-break-out {
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    width: 100vw !important;
    max-width: 100vw !important;
}

/* Centralizar conteúdo quando break-out está ativo */
.esg-schedule-grid-wrapper.esg-break-out .esg-schedule-table-container {
    max-width: var(--esg-width, 1200px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Variante: Break-out apenas se a largura desejada for maior que o container */
.esg-schedule-grid-wrapper.esg-break-out-auto {
    min-width: 100% !important;
}

@media (min-width: 768px) {
    .esg-schedule-grid-wrapper.esg-break-out-auto[style*="width"] {
        position: relative !important;
        left: 50% !important;
        right: 50% !important;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        width: 100vw !important;
        max-width: 100vw !important;
    }
    
    .esg-schedule-grid-wrapper.esg-break-out-auto .esg-schedule-table-container {
        max-width: var(--esg-width, 1200px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

.esg-schedule-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.esg-schedule-table thead th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    color: #fff !important;
}

/* Garantir que todos os cabeçalhos sejam brancos */
.esg-schedule-table thead .esg-col-time,
.esg-schedule-table thead .esg-col-type,
.esg-schedule-table thead .esg-col-title,
.esg-schedule-table thead .esg-col-speaker,
.esg-schedule-table thead .esg-col-location {
    color: #fff !important;
}

.esg-schedule-table tbody tr {
    transition: background-color 0.2s;
    border-bottom: 1px solid #e5e5e5;
}

.esg-schedule-table tbody tr.esg-row-even {
    background-color: #f9f9f9;
}

.esg-schedule-table tbody tr.esg-row-odd {
    background-color: #ffffff;
}

/* Eventos especiais (almoço, coffee break, etc.) */
.esg-schedule-table tbody tr.esg-special-event {
    background-color: #fff3cd !important;
    font-style: italic;
}

.esg-schedule-table tbody tr.esg-special-event .esg-type-badge {
    background-color: #ffc107 !important;
    color: #000 !important;
}

.esg-schedule-table tbody tr:hover {
    background-color: #f0f4ff !important;
}

.esg-schedule-table tbody td {
    padding: 20px 12px;
    vertical-align: top;
}

.esg-schedule-table tbody tr:last-child {
    border-bottom: none;
}

/* Column Specific Styles */
.esg-col-time {
    width: 100px;
    font-weight: 600;
    color: #667eea;
    font-size: 16px;
    white-space: nowrap;
}

.esg-end-time {
    font-size: 13px;
    color: #999;
    font-weight: normal;
    display: block;
    margin-top: 2px;
}

.esg-col-type {
    width: 130px;
}

.esg-type-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Type Colors */
.esg-type-badge.esg-type-palestra {
    background-color: #667eea;
    color: #fff;
}

.esg-type-badge.esg-type-oficina {
    background-color: #f093fb;
    color: #fff;
}

.esg-type-badge.esg-type-mesa-redonda {
    background-color: #4facfe;
    color: #fff;
}

.esg-type-badge.esg-type-default {
    background-color: #95a5a6;
    color: #fff;
}

.esg-col-title {
    min-width: 250px;
    max-width: 400px;
}

.esg-event-title {
    font-size: 18px;
    font-weight: 700;
    color: #23282d;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.esg-event-summary {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.esg-col-speaker {
    min-width: 220px;
    max-width: 300px;
}

.esg-speaker-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.esg-speaker-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
    flex-shrink: 0;
}

.esg-speaker-details {
    flex: 1;
}

.esg-speaker-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #23282d;
    margin-bottom: 3px;
}

.esg-speaker-bio {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

.esg-col-location {
    width: 150px;
    font-size: 14px;
    color: #23282d;
    font-weight: 500;
}

/* Notice */
.esg-notice {
    padding: 15px 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 14px;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .esg-schedule-table {
        min-width: 800px;
        font-size: 13px;
    }
    
    .esg-schedule-table thead th {
        padding: 12px 10px;
        font-size: 13px;
    }
    
    .esg-schedule-table tbody td {
        padding: 15px 10px;
    }
    
    .esg-col-time {
        width: 90px;
        font-size: 15px;
    }
    
    .esg-col-type {
        width: 110px;
    }
    
    .esg-col-title {
        min-width: 200px;
        max-width: 300px;
    }
    
    .esg-event-title {
        font-size: 16px;
    }
    
    .esg-col-speaker {
        min-width: 180px;
        max-width: 250px;
    }
    
    .esg-speaker-photo {
        width: 45px;
        height: 45px;
    }
    
    .esg-col-location {
        width: 120px;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .esg-schedule-table {
        min-width: 750px;
        font-size: 12px;
    }
    
    .esg-schedule-table thead th {
        padding: 10px 8px;
        font-size: 11px;
    }
    
    .esg-schedule-table tbody td {
        padding: 12px 8px;
    }
    
    .esg-col-time {
        width: 80px;
        font-size: 14px;
    }
    
    .esg-end-time {
        font-size: 11px;
    }
    
    .esg-col-type {
        width: 100px;
    }
    
    .esg-type-badge {
        font-size: 10px;
        padding: 4px 10px;
    }
    
    .esg-col-title {
        min-width: 180px;
        max-width: 250px;
    }
    
    .esg-event-title {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .esg-event-summary {
        font-size: 12px;
    }
    
    .esg-col-speaker {
        min-width: 160px;
        max-width: 200px;
    }
    
    .esg-speaker-photo {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
    
    .esg-speaker-name {
        font-size: 13px;
    }
    
    .esg-speaker-bio {
        font-size: 11px;
    }
    
    .esg-col-location {
        width: 100px;
        font-size: 12px;
    }
}

/* Extra Small Screens */
@media (max-width: 480px) {
    .esg-schedule-grid-wrapper {
        margin: 15px 0;
    }
    
    .esg-schedule-table {
        min-width: 700px;
    }
}

/* Scroll Hint para Mobile */
@media (max-width: 768px) {
    .esg-schedule-table-container::after {
        content: '← Deslize para ver mais →';
        display: block;
        text-align: center;
        padding: 10px;
        font-size: 12px;
        color: #667eea;
        font-weight: 600;
        background: #f0f4ff;
        border-radius: 0 0 8px 8px;
    }
    
    .esg-schedule-table-container::-webkit-scrollbar {
        height: 8px;
    }
    
    .esg-schedule-table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .esg-schedule-table-container::-webkit-scrollbar-thumb {
        background: #667eea;
        border-radius: 4px;
    }
    
    .esg-schedule-table-container::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

/* Print Styles */
@media print {
    .esg-schedule-table-container::after {
        display: none;
    }
    
    .esg-schedule-table {
        min-width: 100%;
    }
    
    .esg-schedule-table tbody tr {
        break-inside: avoid;
    }
    
    .esg-schedule-table tbody tr:hover {
        background-color: inherit !important;
    }
}
