/* style.css - Folha de Estilos para o Calendário Público */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f7fa;
    --border-color: #e1e4e8;
    --text-color: #24292e;
    --text-light: #586069;
    --today-bg: #fffbdd;
    --event-color-paid: #316dca;
    --event-color-free: #28a745;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    margin: 0;
    background-image: url('fundo.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 20px;
}

.calendar-container { width: 100%; max-width: 1200px; margin: 0 auto; background: #fff; border-radius: 12px; padding: 25px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); box-sizing: border-box; opacity: 0.9; }
.header-logo { display: block; margin: 0 auto 25px auto; max-width: 150px; height: auto; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.calendar-header h2 { margin: 0; font-size: 1.5rem; font-weight: 600; }
.nav-arrow { text-decoration: none; color: var(--primary-color); font-size: 1.8rem; font-weight: bold; padding: 0 15px; border-radius: 50%; transition: background-color 0.2s; }
.nav-arrow:hover { background-color: #eef4ff; }
.calendar { width: 100%; border-collapse: collapse; table-layout: fixed; }
.calendar th { padding: 12px; text-align: center; font-weight: 500; color: var(--text-light); border-bottom: 2px solid var(--border-color); }
.calendar td { border: 1px solid var(--border-color); height: 120px; vertical-align: top; padding: 8px; transition: background-color 0.2s; overflow-y: auto; }
.calendar td:not(:empty):hover { background-color: #f9f9f9; }
.day-number { font-weight: 500; font-size: 0.9rem; margin-bottom: 5px; }
.day.today .day-number { background-color: var(--primary-color); color: white; border-radius: 50%; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; font-weight: 600; }
.events-list { list-style: none; padding: 0; margin: 0; font-size: 0.8rem; }
.events-list li { color: white; padding: 3px 6px 3px 8px; border-radius: 4px; margin-top: 4px; white-space: normal; word-wrap: break-word; line-height: 1.3; cursor: pointer; border-left: 5px solid; }
.events-list li:hover { filter: brightness(1.1); }
.events-list li.event-paid { background-color: var(--event-color-paid); }
.events-list li.event-free { background-color: var(--event-color-free); }

.legend-wrapper { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border-color); }
.legend-container { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.legend-container:not(:first-child) { margin-top: 10px; }
.legend-item { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 4px; font-size: 0.85rem; font-weight: 500; }
.legend-item.city-legend { background-color: #f0f0f0; border: 1px solid #ddd; border-left-width: 5px; color: var(--text-color); }
.legend-item.event-free, .legend-item.event-paid { color: white; border: 1px solid transparent; }
.legend-item.event-free { background-color: var(--event-color-free); }
.legend-item.event-paid { background-color: var(--event-color-paid); }

.day-name-mobile { display: none; }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.6); }
.modal-content { background-color: #fefefe; margin: 8% auto; padding: 0; border: 1px solid #888; width: 90%; max-width: 700px; border-radius: 12px; box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19); position: relative; overflow: hidden; }
.modal-content iframe { width: 100%; height: 70vh; border: none; display: block; }
.close-button { color: #fff; background-color: rgba(0,0,0,0.3); position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; line-height: 30px; text-align: center; border-radius: 50%; font-size: 28px; font-weight: bold; z-index: 1001; transition: background-color 0.2s; }
.close-button:hover, .close-button:focus { background-color: rgba(0,0,0,0.6); text-decoration: none; cursor: pointer; }
.filter-container { margin-bottom: 20px; text-align: center; }
.city-filter-form select { padding: 8px 12px; border-radius: 6px; border: 1px solid var(--border-color); }

/* --- Event Details (iframe modal) --- */
.details-body{font-family:'Inter',sans-serif;margin:0;padding:0;color:#333;background-color:#fff;}
.details-container{padding:25px;}.header-image{width:100%;height:220px;object-fit:cover;display:block;background-color:#f0f0f0;}
.details-container h1{font-size:1.8rem;margin-top:20px;margin-bottom:10px;}
.location-header{display:flex;align-items:center;gap:8px;margin-bottom:20px;text-decoration:none;color:#555;}
.location-header h2{font-size:1.2rem;font-weight:600;margin:0;}
.meta-info{list-style:none;padding:0;margin:0 0 20px 0;color:#555;border-top:1px solid #eee;padding-top:20px;}
.meta-info li{display:flex;align-items:center;gap:10px;margin-bottom:8px;font-size:0.95rem;}
.meta-info a{color:#316dca;text-decoration:none;font-weight:500;}
.meta-info a:hover{text-decoration:underline;}
.description{border-top:1px solid #eee;padding-top:20px;line-height:1.6;}
.description *{max-width:100%;height:auto;}
.occ-list{margin:0;padding:0;list-style:none;}
.occ-row{display:flex;align-items:center;gap:10px;margin-bottom:6px;padding:6px 10px;border-radius:6px;transition:background-color .2s;font-size:0.95rem;}
.occ-row.highlight{background-color:#e8f4fd;border-left:3px solid var(--primary-color,#4a90e2);}
.occ-date{font-weight:600;color:#333;}
.occ-time{color:#777;}
.occ-title{color:#555;font-style:italic;}
.occ-views{font-size:0.8rem;color:#999;margin-left:auto;white-space:nowrap;}

/* --- Modal Loading --- */
.modal-loading{display:flex;align-items:center;justify-content:center;height:70vh;color:#999;font-size:1rem;gap:12px;}
.modal-loading .spinner{width:24px;height:24px;border:3px solid #eee;border-top-color:#4a90e2;border-radius:50%;animation:spin .8s linear infinite;}
@keyframes spin{to{transform:rotate(360deg)}}

@media (max-width: 768px) {
    body { padding: 0; }
    .calendar-container { padding: 0; border-radius: 0; box-shadow: none; opacity: 1; }
    .calendar-header { padding: 10px 15px; }
    .calendar-header h2 { font-size: 1.2rem; }
    .calendar thead { display: none; }
    .calendar, .calendar tbody, .calendar tr { display: block; }
    .calendar td { display: flex; height: auto !important; padding: 12px 10px; border: none; border-bottom: 1px solid var(--border-color); align-items: flex-start; }
    .calendar td:empty { display: none; }
    .date-info-wrapper { flex: 0 0 65px; text-align: center; padding-right: 10px; margin-right: 10px; border-right: 1px solid #eee; }
    .day-name-mobile { display: block; font-size: 0.7rem; color: var(--text-light); text-transform: uppercase; font-weight: 500; }
    .day-number { font-size: 1.5rem; font-weight: 600; margin-bottom: 0; background-color: transparent !important; color: var(--text-color) !important; width: auto !important; height: auto !important; border-radius: 0 !important; display: inline !important; }
    .day.today .date-info-wrapper { color: var(--primary-color); font-weight: bold; }
    .events-list { flex: 1; padding-top: 4px; }
    .events-list li { font-size: 0.85rem; }
    .legend-wrapper { padding: 15px; border-top: 1px solid var(--border-color); }
    .modal-content { width: 100%; height: 100%; margin: 0; border-radius: 0; border: none; }
    .modal-content iframe { height: 100%; }
}
