/**
 * CSS Frontend - Quadras Reservas
 * Sistema completo de reservas
 */

/* ==========================================
   RESET E CONFIGURAÇÕES GLOBAIS
   ========================================== */

* {
    box-sizing: border-box;
}

/* ==========================================
   CONTAINER PRINCIPAL
   ========================================== */

.quadras-reservas-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto !important;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f9fafb;
}

@media (min-width: 1600px) {
    .quadras-reservas-container {
        max-width: 1600px;
    }
}

@media (max-width: 768px) {
    .quadras-reservas-container {
        padding: 10px;
    }
}

/* ==========================================
   HEADER
   ========================================== */

.quadras-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.quadras-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.2em;
    font-weight: 700;
}

.quadras-header .subtitle {
    margin: 0;
    font-size: 1.1em;
    opacity: 0.95;
    font-weight: 400;
}

@media (max-width: 768px) {
    .quadras-header h1 {
        font-size: 1.6em;
    }
    
    .quadras-header .subtitle {
        font-size: 0.95em;
    }
}

/* ==========================================
   SISTEMA DE ABAS
   ========================================== */

.quadras-tabs {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.tabs-nav {
    display: flex;
    background: #f3f4f6;
    border-bottom: 2px solid #e5e7eb;
    overflow-x: auto;
}

.tab-button {
    flex: 1;
    min-width: 150px;
    padding: 18px 20px;
    background: transparent;
    border: none;
    font-size: 1em;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
}

.tab-button:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.tab-button.active {
    background: white;
    color: #2563eb;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: #2563eb;
}

@media (max-width: 768px) {
    .tab-button {
        min-width: 120px;
        padding: 15px 12px;
        font-size: 0.9em;
    }
}

/* ==========================================
   CONTEÚDO DAS ABAS
   ========================================== */

.tabs-content {
    padding: 30px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-header {
    margin-bottom: 25px;
}

.tab-header h2 {
    margin: 0 0 10px 0;
    color: #1f2937;
    font-size: 1.8em;
}

.tab-description {
    margin: 0;
    color: #6b7280;
    font-size: 1.05em;
}

@media (max-width: 768px) {
    .tabs-content {
        padding: 20px 15px;
    }
    
    .tab-header h2 {
        font-size: 1.4em;
    }
}

/* ==========================================
   CALENDÁRIO - CONTAINER
   ========================================== */

.calendario-container {
    margin: 20px 0;
}

.calendario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #2563eb;
}

.calendario-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.3em;
}

.calendario-semana-info {
    color: #6b7280;
    font-weight: 600;
    font-size: 0.95em;
}

@media (max-width: 768px) {
    .calendario-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ==========================================
   CALENDÁRIO - TABELA
   ========================================== */

.calendario-tabela {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.calendario-tabela thead th {
    background: #2563eb;
    color: white;
    padding: 16px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95em;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.calendario-tabela thead th:last-child {
    border-right: none;
}

.calendario-tabela thead th.horario-col {
    width: 100px;
    min-width: 100px;
}

.calendario-tabela thead th.dia-col {
    width: auto;
}

.dia-header-tabela {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dia-nome-tabela {
    font-weight: 700;
    font-size: 1.05em;
}

.dia-data-tabela {
    font-size: 0.9em;
    opacity: 0.95;
}

.feriado-badge-small {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-top: 4px;
}

/* Corpo da tabela */
.calendario-tabela tbody td {
    padding: 0;
    border: 1px solid #e5e7eb;
    vertical-align: middle;
}

.calendario-tabela tbody td.horario-label {
    background: #f9fafb;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    padding: 16px 12px;
    font-size: 0.95em;
}

/* ==========================================
   SLOTS DO CALENDÁRIO
   ========================================== */

.slot-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px 12px;
    min-height: 80px;
    transition: all 0.2s ease;
}

.slot-icon {
    font-size: 1.8em;
}

.slot-text {
    font-size: 0.85em;
    font-weight: 600;
    text-align: center;
}

/* Slot Disponível */
.slot-disponivel {
    background: #f0fdf4;
    color: #166534;
    cursor: pointer;
}

.slot-disponivel:hover {
    background: #dcfce7;
    transform: scale(1.02);
    box-shadow: inset 0 0 0 2px #22c55e;
}

.slot-disponivel .slot-text {
    color: #16a34a;
}

/* Slot Reservado */
.slot-reservado {
    background: #fef2f2;
    color: #991b1b;
}

.slot-reservado .slot-text {
    color: #dc2626;
}

/* Slot Comissão */
.slot-comissao {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    cursor: pointer;
}

.slot-comissao:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    transform: scale(1.02);
    box-shadow: inset 0 0 0 2px #f59e0b;
}

.slot-comissao .slot-text {
    color: #b45309;
    font-weight: 700;
}

/* Slot Bloqueado */
.slot-bloqueado {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.slot-bloqueado .slot-text {
    color: #9ca3af;
}

/* Slot Vazio */
.slot-vazio {
    background: #fafafa;
    color: #d1d5db;
    text-align: center;
    font-size: 1.2em;
}

@media (max-width: 768px) {
    .calendario-tabela {
        font-size: 0.85em;
    }
    
    .slot-content {
        padding: 12px 6px;
        min-height: 60px;
        gap: 4px;
    }
    
    .slot-icon {
        font-size: 1.4em;
    }
    
    .slot-text {
        font-size: 0.75em;
    }
}

/* ==========================================
   LEGENDA
   ========================================== */

.calendario-legenda {
    margin-top: 25px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.calendario-legenda h4 {
    margin: 0 0 15px 0;
    color: #1f2937;
    font-size: 1.1em;
}

.legenda-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.legenda-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legenda-icon {
    font-size: 1.3em;
}

.legenda-item span:last-child {
    color: #4b5563;
    font-weight: 500;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .legenda-items {
        flex-direction: column;
        gap: 12px;
    }
}

/* ==========================================
   LOADING
   ========================================== */

.calendario-loading,
.reservas-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.calendario-loading p,
.reservas-loading p {
    margin-top: 15px;
    color: #6b7280;
    font-size: 0.95em;
}

/* ==========================================
   MINHAS RESERVAS
   ========================================== */

.minhas-reservas-container {
    margin: 20px 0;
}

.reservas-lista {
    display: grid;
    gap: 20px;
}

.reserva-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.reserva-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.reserva-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f3f4f6;
}

.reserva-id {
    font-weight: 700;
    color: #1f2937;
    font-size: 1.1em;
}

.reserva-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reserva-status.ativa {
    background: #d1fae5;
    color: #065f46;
}

.reserva-status.cancelada {
    background: #fee2e2;
    color: #991b1b;
}

.reserva-status.expirada {
    background: #f3f4f6;
    color: #6b7280;
}

.reserva-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-size: 0.8em;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1em;
    color: #1f2937;
    font-weight: 600;
}

.reserva-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f3f4f6;
}

@media (max-width: 768px) {
    .reserva-info {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .reserva-actions {
        flex-direction: column;
    }
}

/* ==========================================
   INFORMAÇÕES
   ========================================== */

.informacoes-content {
    display: grid;
    gap: 20px;
}

.info-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #2563eb;
}

.info-card h3 {
    margin: 0 0 15px 0;
    color: #1f2937;
    font-size: 1.3em;
}

.info-card p {
    margin: 0 0 10px 0;
    color: #4b5563;
    line-height: 1.6;
}

.info-card ul {
    margin: 0;
    padding-left: 20px;
}

.info-card ul li {
    margin: 8px 0;
    color: #4b5563;
    line-height: 1.6;
}

.info-card code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #dc2626;
}

.info-card a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.info-card a:hover {
    text-decoration: underline;
}

/* ==========================================
   MODAL
   ========================================== */

.quadras-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    background: white;
    max-width: 600px;
    width: 90%;
    margin: 50px auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content.modal-small {
    max-width: 450px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.modal-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.5em;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 2em;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
}

/* ==========================================
   FORMULÁRIO
   ========================================== */

.reserva-info-display {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #2563eb;
}

.reserva-info-display .info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.reserva-info-display .info-label {
    font-weight: 600;
    color: #6b7280;
}

.reserva-info-display .info-item span:last-child {
    font-weight: 700;
    color: #1f2937;
    font-size: 1.05em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 0.95em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-help {
    display: block;
    margin-top: 6px;
    font-size: 0.85em;
    color: #6b7280;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 25px;
}

@media (max-width: 768px) {
    .form-actions {
        flex-direction: column-reverse;
    }
}

/* ==========================================
   BOTÕES
   ========================================== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #2563eb;
    color: white;
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-danger:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================
   MENSAGENS
   ========================================== */

.message {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: 500;
}

.message-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.message-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.message-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

/* ==========================================
   COMISSÃO INFO MODAL
   ========================================== */

.comissao-info {
    text-align: center;
    padding: 20px;
}

.comissao-info h3 {
    color: #b45309;
    margin: 0 0 15px 0;
    font-size: 1.5em;
}

.comissao-info p {
    color: #4b5563;
    line-height: 1.7;
    margin: 12px 0;
}

/* ==========================================
   LOGIN REQUIRED
   ========================================== */

.quadras-login-required {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: 40px 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
}

.login-card h3 {
    margin: 0 0 15px 0;
    color: #1f2937;
    font-size: 1.8em;
}

.login-card p {
    margin: 0 0 25px 0;
    color: #6b7280;
}

.btn-login {
    display: inline-block;
    padding: 14px 32px;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-login:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}