/*
 * Events Manager Custom Overrides
 * Harmonização do Events Manager com a identidade visual Tailwind/Flowbite da Câmara
 */

/* Calendário Global */
.em-calendar-wrapper { margin-bottom: 2rem; }
table.em-calendar { width: 100%; border-collapse: collapse; background-color: #fff; border-radius: 0.5rem; overflow: hidden; border: 1px solid #e5e7eb; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
table.em-calendar thead { background-color: #f9fafb; border-bottom: 1px solid #e5e7eb; }
table.em-calendar th { padding: 0.75rem 1rem; font-weight: 600; text-align: center; color: #374151; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; }
table.em-calendar td { padding: 1rem; text-align: center; border: 1px solid #e5e7eb; color: #4b5563; }
table.em-calendar td a { color: var(--cmp-primary); font-weight: bold; text-decoration: none; display: block; border-radius: 0.25rem; transition: background 0.2s; }
table.em-calendar td a:hover { background-color: #f3f4f6; text-decoration: none; }
table.em-calendar td.eventful-today { background-color: var(--cmp-primary) !important; color: #fff !important; }
table.em-calendar td.eventful-today a { color: #fff !important; }

/* Listagens de Eventos (.em-events-list, .css-events-list) */
.em-events-list, .css-events-list { margin-bottom: 2rem; }
.em-events-list table.events-table, .css-events-list table.events-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 0.5rem; border: 1px solid #e5e7eb; overflow: hidden; box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.em-events-list table.events-table thead, .css-events-list table.events-table thead { background-color: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.em-events-list table.events-table th, .css-events-list table.events-table th { padding: 0.75rem 1rem; text-align: left; font-weight: 600; color: #374151; font-size: 0.875rem; }
.em-events-list table.events-table td, .css-events-list table.events-table td { padding: 1rem; border-bottom: 1px solid #e5e7eb; color: #4b5563; vertical-align: top; }
.em-events-list table.events-table tr:last-child td, .css-events-list table.events-table tr:last-child td { border-bottom: none; }
.em-events-list table.events-table a, .css-events-list table.events-table a { color: var(--cmp-primary); font-weight: 500; text-decoration: none; }
.em-events-list table.events-table a:hover, .css-events-list table.events-table a:hover { color: #111111; text-decoration: underline; }

/* Hero Search */
#cmp-hero-search-form { max-width: 52rem; margin: 2.5rem auto 0; }
#cmp-hero-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
#cmp-hero-search {
    width: 100%;
    height: 68px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 9999px;
    background: rgba(244, 239, 232, 0.08);
    color: rgba(255, 255, 255, 0.96);
    padding: 0 7rem 0 3.2rem;
    font-size: 1.05rem;
    line-height: 1.5;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
#cmp-hero-search::placeholder { color: rgba(255, 255, 255, 0.72); }
#cmp-hero-search:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(244, 239, 232, 0.10);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.22);
}
#cmp-hero-search::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
}
#cmp-hero-search-button {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.92);
    color: #ffffff;
    height: 52px;
    min-width: 52px;
    padding: 0 1.25rem;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
    transition: background-color 0.2s ease, transform 0.2s ease;
}
#cmp-hero-search-button:hover {
    background: rgba(0, 0, 0, 1);
    transform: translateY(-50%) scale(1.01);
}
#cmp-hero-search-button svg {
    width: 1rem;
    height: 1rem;
}

@media (max-width: 640px) {
    #cmp-hero-search { height: 60px; padding-right: 4.5rem; }
    #cmp-hero-search-button {
        height: 46px;
        min-width: 46px;
        padding: 0 0.9rem;
    }
}

/* Formulário de Busca (.em-search) */
.em-search { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 1.5rem; margin-bottom: 2rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.em-search input[type="text"], .em-search select, .em-search input[type="date"] { border: 1px solid #d1d5db; border-radius: 0.5rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; color: #374151; background: #fff; width: 100%; max-width: 250px; transition: border-color 0.2s, box-shadow 0.2s; }
.em-search input:focus, .em-search select:focus { outline: none; border-color: var(--cmp-primary); box-shadow: 0 0 0 3px rgba(35, 31, 32, 0.1); }
.em-search input[type="submit"], .em-search button.em-search-submit { background-color: var(--cmp-primary); color: #fff; border-radius: 0.5rem; padding: 0.5rem 1.5rem; font-weight: 500; border: none; cursor: pointer; transition: all 0.2s; height: auto; }
.em-search input[type="submit"]:hover, .em-search button.em-search-submit:hover { background-color: #111111; transform: translateY(-1px); }

/* Formulários de Reserva / Ticket (.em-booking) */
#em-booking { background: #fff; border: 1px solid #e5e7eb; padding: 2rem; border-radius: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05); margin-top: 2rem; }
#em-booking h3 { font-size: 1.25rem; font-weight: bold; color: var(--cmp-primary); margin-bottom: 1.5rem; border-bottom: 1px solid #e5e7eb; padding-bottom: 0.5rem; }
#em-booking .em-booking-form-details { width: 100% !important; float: none !important; padding: 0 !important; }
#em-booking .em-booking-form label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: #374151; width: auto !important; float: none !important; }
#em-booking .em-booking-form input.input, #em-booking .em-booking-form textarea, #em-booking .em-booking-form select { width: 100% !important; border: 1px solid #d1d5db; border-radius: 0.5rem; padding: 0.75rem 1rem; margin-bottom: 1.25rem; background: #fff; max-width: 100%; transition: border-color 0.2s, box-shadow 0.2s; }
#em-booking .em-booking-form input:focus, #em-booking .em-booking-form textarea:focus { outline: none; border-color: var(--cmp-primary); box-shadow: 0 0 0 3px rgba(35, 31, 32, 0.1); }
#em-booking .em-booking-form p { margin-bottom: 1rem; }
#em-booking .em-booking-form input.em-booking-submit { background-color: var(--cmp-primary); color: #fff !important; padding: 0.75rem 2rem; font-weight: 500; border-radius: 0.5rem; cursor: pointer; border: none; width: auto !important; margin-top: 1rem; transition: background-color 0.2s, transform 0.2s; }
#em-booking .em-booking-form input.em-booking-submit:hover { background-color: #111111; transform: translateY(-1px); }

/* Tabela de Ingressos (Tickets) */
#em-booking table.em-tickets { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; border: 1px solid #e5e7eb; border-radius: 0.5rem; overflow: hidden; }
#em-booking table.em-tickets th { background: #f9fafb; padding: 0.75rem; border-bottom: 1px solid #e5e7eb; text-align: left; font-size: 0.875rem; color: #4b5563; font-weight: 600; }
#em-booking table.em-tickets td { padding: 0.75rem; border-bottom: 1px solid #e5e7eb; color: #374151; }

/* Box de Mensagens de Sucesso / Erro */
#em-booking div.em-booking-message { padding: 1rem; border-radius: 0.5rem; margin-bottom: 1.5rem; font-weight: 500; border-left-width: 4px; }
#em-booking div.em-booking-message-success { background-color: #f0fdf4; border-color: #bbf7d0; border-left-color: #22c55e; color: #166534; }
#em-booking div.em-booking-message-error { background-color: #fef2f2; border-color: #fecaca; border-left-color: #ef4444; color: #991b1b; }

/* Ajustes de acessibilidade e hierarquia da página de evento */
.event-meta-card { min-height: 120px; }
.event-meta-label { display: block; margin-bottom: 0.5rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #4b5563; }
.event-meta-value { font-size: 1rem; line-height: 1.45; }
.event-meta-subvalue { margin-top: 0.35rem; font-size: 0.9rem; line-height: 1.5; }
.event-booking-panel .booking-form-wrapper > .em-booking { margin-top: 0; }
.event-booking-panel #em-booking { margin-top: 0; border: 1px solid #d1d5db; background: #ffffff; }
.event-booking-panel #em-booking h3 { font-size: 1.15rem; color: #111827; }
.event-booking-panel #em-booking .em-booking-form input.em-booking-submit,
.event-booking-panel #em-booking input[type="submit"] { min-height: 44px; }

@media (max-width: 767px) {
    .event-meta-card { min-height: unset; }
    .event-booking-panel { padding: 1.25rem; }
}

/* Ajustes visuais para links e badges do EM */
.em-item-taxonomy a,
#em-booking a,
.em-booking-form a,
.em-event-content a,
.entry-content a { text-decoration: underline; }
.em-item-taxonomy a:hover,
#em-booking a:hover,
.em-booking-form a:hover,
.em-event-content a:hover,
.entry-content a:hover { text-decoration-thickness: 2px; }

.em-booking-form input[type="radio"],
.em-booking-form input[type="checkbox"] { accent-color: var(--cmp-primary); }
.em-booking-form .em-booking-form-details { max-width: 100%; }
.em-booking-form .em-booking-form-details .em-booking-form-row { margin-bottom: 1rem; }
.em-booking-form .em-booking-form-details textarea { min-height: 110px; }