:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    --color-disponivel: #e2e8f0;
    --color-disponivel-hover: #cbd5e1;
    --color-reservado: #fef08a;
    --color-reservado-hover: #fde047;
    --color-pago: #bbf7d0;
    --color-pago-hover: #86efac;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    padding: 20px;
    display: flex;
    justify-content: center;
}

.calendar-container {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    max-width: 950px;
    width: 100%;
}

.rifa-title {
    text-align: center;
    margin-bottom: 16px;
    color: var(--primary);
    font-size: 2rem;
}

/* Bloco do Topo */
.rifa-header-block {
    display: flex;
    gap: 25px;
    background-color: #f1f5f9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    border-left: 4px solid var(--primary);
    align-items: center;
}

.rifa-description {
    flex: 1;
}

.rifa-description h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 6px;
}

.rifa-description p {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
}

/* CARROSSEL DE FOTOS */
.carousel-container {
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.carousel-main {
    position: relative;
    width: 100%;
    height: 180px;
    background-color: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.carousel-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.2s;
}

.carousel-main img:hover { transform: scale(1.02); }

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 4px;
    transition: background 0.2s;
    z-index: 5;
}

.carousel-btn:hover { background: rgba(0, 0, 0, 0.7); }
.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }

.carousel-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    text-align: center;
    padding: 4px;
}

.carousel-thumbs {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.carousel-thumbs .thumb {
    width: 55px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.6;
    transition: all 0.2s;
}

.carousel-thumbs .thumb:hover, .carousel-thumbs .thumb.active {
    opacity: 1;
    border-color: var(--primary);
}

/* SISTEMA DE ZOOM LIGHTBOX COM SETAS INTERNAS */
.lightbox-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 80%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    animation: zoomIn 0.2s ease;
    z-index: 2010;
}

.lightbox-close {
    position: absolute;
    top: 20px; right: 35px;
    color: #f1f5f9;
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 2020;
}

.lightbox-close:hover { color: #94a3b8; }

/* Setas flutuantes no modo Zoom */
.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2020;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
    transform: translateY(-50%) scale(1.05);
}

.lightbox-prev { left: 40px; }
.lightbox-next { right: 40px; }

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Grade Dinâmica 10x10 */
.calendar-grid-10x10 {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    margin-bottom: 28px;
}

.rifa-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.2s;
    border: 1px solid rgba(0,0,0,0.05);
    padding: 4px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.rifa-cell .buyer-name {
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 4px;
    color: #334155;
    z-index: 1;
}

.rifa-cell.cell-pago::before {
    content: "PAGO";
    position: absolute;
    font-size: 0.8rem;
    font-weight: 900;
    color: #166534;
    border: 2px solid #166534;
    padding: 1px 3px;
    border-radius: 4px;
    transform: rotate(-15deg);
    opacity: 0.85;
    background: rgba(187, 247, 208, 0.7);
    z-index: 2;
    pointer-events: none;
    letter-spacing: 0.5px;
}

.cell-disponivel { background-color: var(--color-disponivel); }
.cell-disponivel:hover { background-color: var(--color-disponivel-hover); }
.cell-reservado { background-color: var(--color-reservado); }
.cell-reservado:hover { background-color: var(--color-reservado-hover); }
.cell-pago { background-color: var(--color-pago); }
.cell-pago:hover { background-color: var(--color-pago-hover); }

/* Seção Inferior */
.info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 10px;
}

.stats-container h2, .buyers-container h2 {
    font-size: 1.15rem;
    margin-bottom: 12px;
    color: var(--text-main);
    border-bottom: 2px solid var(--border);
    padding-bottom: 6px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.stats-table th {
    padding: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 6px 6px 0 0;
}

.th-disponivel { background-color: var(--color-disponivel); color: #475569; }
.th-reservado { background-color: #fde047; color: #713f12; }
.th-pago { background-color: var(--color-pago); color: #166534; }

.stats-table td {
    padding: 16px;
    font-size: 1.5rem;
    font-weight: bold;
    border: 1px solid var(--border);
    border-top: none;
}

.buyers-list-wrapper {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.buyers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.buyers-table th {
    background-color: #e2e8f0;
    color: var(--text-main);
    padding: 8px 12px;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.buyers-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    color: #334155;
}

.buyers-table tr:last-child td { border-bottom: none; }
.empty-list { text-align: center; color: var(--text-muted); font-style: italic; padding: 20px !important; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.2s; z-index: 1000;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal-content { background: var(--bg-card); padding: 24px; border-radius: 12px; max-width: 400px; width: 90%; box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1); }
.modal-content h3 { margin-bottom: 16px; }
.modal-field { margin-bottom: 16px; }
.modal-field label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9rem; }
.modal-input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 1rem; outline: none; }
.modal-input:focus { border-color: var(--primary); }
.modal-buttons { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.modal-btn { padding: 10px 16px; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn-cancelar { background: var(--border); color: var(--text-main); }
.btn-salvar { background: var(--primary); color: white; }
.btn-salvar:hover { background-color: var(--primary-hover); }

/* Responsividade */
@media (max-width: 768px) {
    .rifa-header-block { flex-direction: column; }
    .carousel-container { width: 100%; max-width: 400px; }
    .carousel-main { height: 250px; }
    .lightbox-prev { left: 15px; }
    .lightbox-next { right: 15px; }
    .lightbox-btn { width: 40px; height: 40px; font-size: 1.2rem; }
    .calendar-grid-10x10 { grid-template-columns: repeat(5, 1fr); }
    .info-section { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 480px) {
    .calendar-grid-10x10 { grid-template-columns: repeat(4, 1fr); gap: 5px; }
    .rifa-cell { font-size: 0.9rem; padding: 4px; }
    .rifa-cell .buyer-name { font-size: 0.7rem; }
}
/* adicione isso para bloquear totalmente os cliques das pessoas */
.calendar-grid-10x10 {
    pointer-events: none; /* Desativa qualquer clique ou abertura de modal na grade */
}
