/**
 * Estilos do Sistema de Locações
 * Design limpo, profissional e responsivo
 */

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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f6f9;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== CABEÇALHO ==================== */

.header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    transition: opacity 0.3s;
}

.logo a:hover {
    opacity: 0.9;
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255,255,255,0.2);
}

/* ==================== CONTEÚDO PRINCIPAL ==================== */

.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.page-title {
    color: #1f2937;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #2563eb;
    font-size: 2rem;
}

/* ==================== CARDS DE IMÓVEIS ==================== */

.imoveis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card-imovel {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card-imovel:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.card-imovel h3 {
    color: #2563eb;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.card-imovel p {
    color: #666;
    margin-bottom: 0.5rem;
}

.card-imovel .cidade {
    font-weight: 600;
    color: #333;
}

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

.btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    text-align: center;
    font-weight: 500;
}

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

.btn-primary:hover {
    background: #1e40af;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* ==================== DETALHES DO IMÓVEL ==================== */

.imovel-header {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.imovel-header h2 {
    color: #2563eb;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

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

.info-item {
    padding: 0.5rem;
}

.info-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.info-value {
    color: #333;
    font-size: 1rem;
}

/* ==================== SEÇÕES ==================== */

.secao {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.secao h3 {
    color: #2563eb;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    font-size: 1.4rem;
}

/* ==================== TABELAS ==================== */

.tabela-locacoes {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.tabela-locacoes th,
.tabela-locacoes td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.tabela-locacoes th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.95rem;
}

.tabela-locacoes tbody tr:hover {
    background: #f9fafb;
}

.tabela-locacoes tfoot tr {
    font-weight: bold;
}

/* ==================== BADGES (STATUS) ==================== */

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

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

.badge-encerrada {
    background: #fee2e2;
    color: #991b1b;
}

/* ==================== FORMULÁRIOS ==================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    font-family: inherit;
}

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

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ==================== ALERTAS ==================== */

.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

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

/* ==================== RODAPÉ ==================== */

.footer {
    background: #1f2937;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

.footer p {
    margin: 0;
}

/* ==================== AÇÕES (BOTÕES EM LINHA) ==================== */

.acoes {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

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

.sem-dados {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
    font-style: italic;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
}

/* ==================== RESPONSIVIDADE ==================== */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .nav {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .nav-link {
        display: block;
    }
    
    .imoveis-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .tabela-locacoes {
        font-size: 0.85rem;
    }
    
    .tabela-locacoes th,
    .tabela-locacoes td {
        padding: 0.5rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .secao {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .acoes {
        flex-direction: column;
    }
    
    .acoes .btn {
        width: 100%;
    }
}


/* Estilo para datas ocupadas no calendário */
.flatpickr-day.data-ocupada {
    position: relative;
    color: #b30000 !important;
    background-color: #ffb5b5 !important;
}

/* Linha diagonal (/) atravessando o dia */
.flatpickr-day.data-ocupada::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: .3px; /* espessura da linha */
    background: #b3000072; /* cor da linha */
    transform: rotate(-45deg); /* inclinação da linha */
    transform-origin: center;
    pointer-events: none; /* não bloqueia clique */
}

/* Parcela paga completamente (verde) */
.parcela-paga {
    background-color: #f0fdf4 !important;
}

.parcela-paga td {
    opacity: 0.8;
}

/* Parcela paga parcialmente (amarelo) */
.parcela-parcial {
    background-color: #fef9e7 !important;
}

.parcela-parcial td {
    opacity: 0.95;
}

/* Badge para status pago parcialmente (amarelo) */
.badge-parcial {
    background: #fef3c7;
    color: #92400e;
}

/* Badge para status pago (verde) - já existe mas garantindo */
.badge-ativa {
    background: #d1fae5;
    color: #065f46;
}

/* Badge para status pendente (cinza) - já existe mas garantindo */
.badge-encerrada {
    background: #fee2e2;
    color: #991b1b;
}


.display-flex{
    display: flex;
    gap: 1rem;
}

.display-flex .secao {
    width: 50%;
}

@media (max-width: 1200px) {

    .display-flex{
        display: block;
    }

    .display-flex .secao {
        width: 100%;
    }
}

@media (max-width: 980px) {

    .display-flex{
        display: block;
    }
}