/**
 * Estilos do Sistema CaronaBTZ
 * Sistema de Reserva e Compartilhamento de Carros - Laravel
 */

/* === Layout Geral === */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #1e3a5f;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === Navbar === */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
}

/* === Main Content === */
.main-content {
    margin-top: 70px;
    flex: 1;
    padding-bottom: 20px;
}

/* === Cards === */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    border-radius: 12px 12px 0 0 !important;
}

/* === Status Cards (Dashboard) === */
.status-card {
    transition: all 0.2s ease;
    background-color: #fff;
}

.status-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: #f8f9fa;
}

/* === Badges === */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

.badge-warning { background-color: #ffc107; color: #000; }
.badge-info { background-color: #0dcaf0; color: #000; }
.badge-primary { background-color: #0d6efd; color: #fff; }
.badge-success { background-color: #198754; color: #fff; }
.badge-danger { background-color: #dc3545; color: #fff; }
.badge-secondary { background-color: #6c757d; color: #fff; }

/* === Buttons === */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0a58ca 0%, #084298 100%);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    border: none;
}

/* === Forms === */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.6rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.3rem;
}

/* === Tables === */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: #495057;
    border-top: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* === Alerts === */
.alert {
    border: none;
    border-radius: 10px;
}

/* === Footer === */
.footer {
    background-color: #fff;
    border-top: 1px solid #eee;
}

/* === Notificacoes Dropdown === */
.notifications-dropdown {
    max-height: 400px;
    overflow-y: auto;
}

.notifications-dropdown .list-group-item {
    border: none;
    border-bottom: 1px solid #f0f0f0;
}

.notifications-dropdown .list-group-item:hover {
    background-color: #f8f9fa;
}

/* === Notification Bell Badge === */
#notificationCount {
    font-size: 0.6rem;
    padding: 0.08em 0.5em;
    line-height: 1;
    min-width: 15px;
    height: 15x;
    transform: translate(-60%, -40%) !important;
}

/* === Flatpickr — igualar altura dos inputs ao Bootstrap === */
input.flatpickr-input.form-control,
.flatpickr-input.form-control {
    height: auto;
    padding: 0.6rem 1rem;
}

/* === Select2 Customizacao === */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 8px;
}

/* === Progress Bars === */
.progress {
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
}

/* === Timeline === */
.timeline-container {
    padding: 10px;
}

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

.card {
    animation: fadeIn 0.3s ease;
}

/* === Status Colors === */
.status-solicitada { color: #ffc107; }
.status-em_negociacao { color: #0dcaf0; }
.status-consolidada { color: #0d6efd; }
.status-aprovada { color: #198754; }
.status-em_andamento { color: #0d6efd; }
.status-concluida { color: #198754; }
.status-cancelada { color: #dc3545; }

/* === Loading === */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* === Tooltips customizados === */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: #333;
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
}

/* === Card de estatistica === */
.stat-card {
    text-align: center;
    padding: 1.5rem;
    position: relative;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Passageiros List === */
.passageiro-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

.passageiro-item:last-child {
    border-bottom: none;
}

.passageiro-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

/* === Proposta Card === */
.proposta-card {
    transition: all 0.3s ease;
}

.proposta-card:hover {
    transform: translateY(-5px);
}

.proposta-card.valida {
    border-left: 4px solid #198754;
}

.proposta-card.requer-aprovacao {
    border-left: 4px solid #ffc107;
}

/* === Admin Sidebar === */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    overflow-y: auto;
    z-index: 1040;
    transition: transform 0.3s ease;
}

.admin-sidebar .nav-link {
    padding: 0.65rem 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    margin: 2px 8px;
    transition: all 0.2s ease;
}

.admin-sidebar .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.admin-sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

.admin-sidebar .nav-link i {
    width: 24px;
    text-align: center;
}

.admin-content {
    margin-left: 260px;
    min-height: 100vh;
    background-color: #f5f7fa;
}

.admin-topbar {
    background-color: #fff;
    border-bottom: 1px solid #eee;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* === Otimizacao Drag & Drop === */
.grupo-card {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    min-height: 100px;
    transition: border-color 0.2s ease;
}

.grupo-card.drag-over {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

.reserva-drag-item {
    cursor: grab;
    transition: transform 0.2s ease;
}

.reserva-drag-item:active {
    cursor: grabbing;
}

.reserva-drag-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

/* === Responsividade === */
@media (max-width: 768px) {
    .main-content {
        margin-top: 60px;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .display-1 {
        font-size: 2rem;
    }

    .display-4 {
        font-size: 1.5rem;
    }

    /* Admin responsive */
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-content {
        margin-left: 0;
    }
}

@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-content {
        margin-left: 0;
    }
}

/* === Print styles === */
@media print {
    .navbar, .footer, .btn, .no-print, .admin-sidebar {
        display: none !important;
    }

    .main-content, .admin-content {
        margin-top: 0;
        margin-left: 0;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
