/* =============================================
   Agendamentos - Front Office Styles
   ============================================= */

/* General */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.min-vh-75 {
    min-height: 75vh;
}

/* Navbar */
.navbar-brand {
    font-size: 1.3rem;
}

.nav-link.active {
    font-weight: 600;
    color: #0d6efd !important;
}

/* Cards */
.card {
    border-radius: 0.75rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1) !important;
}

.card-stats {
    border-left: 4px solid;
}

.card-stats.border-primary { border-left-color: #0d6efd; }
.card-stats.border-success { border-left-color: #198754; }
.card-stats.border-warning { border-left-color: #ffc107; }
.card-stats.border-info    { border-left-color: #0dcaf0; }
.card-stats.border-danger  { border-left-color: #dc3545; }

/* Status badges */
.badge {
    font-weight: 500;
    font-size: 0.8em;
}

/* Calendar */
.fc {
    font-family: inherit;
}

.fc .fc-toolbar-title {
    font-size: 1.2rem;
    text-transform: capitalize;
}

.fc .fc-button {
    font-size: 0.85rem;
}

.fc-event {
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85rem;
}

/* Booking form steps */
.step-indicator {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.step-indicator .step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.step-indicator .step.active {
    color: #0d6efd;
    font-weight: 600;
}

.step-indicator .step.completed {
    color: #198754;
}

.step-indicator .step .step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    font-weight: 600;
    font-size: 0.85rem;
}

.step-indicator .step.active .step-number {
    background: #0d6efd;
    color: white;
}

.step-indicator .step.completed .step-number {
    background: #198754;
    color: white;
}

/* Time slots grid */
.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
}

.time-slot {
    padding: 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
}

.time-slot:hover {
    border-color: #0d6efd;
    background: #f0f6ff;
}

.time-slot.selected {
    border-color: #0d6efd;
    background: #0d6efd;
    color: white;
}

.time-slot.unavailable {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #6c757d;
    border-bottom-width: 2px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}

[data-bs-theme="dark"] .loading-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.loading-overlay.active {
    display: flex;
}

/* Auto-dismiss alerts */
.alert {
    animation: fadeInDown 0.3s ease;
}

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

/* Dark mode adjustments */
[data-bs-theme="dark"] .card {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .navbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .mobile-bottom-nav {
    background: var(--bs-body-bg);
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] footer {
    background: var(--bs-body-bg) !important;
    border-top-color: rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] .time-slot {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .time-slot:hover {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.15);
}

[data-bs-theme="dark"] .step-indicator .step .step-number {
    background: rgba(255, 255, 255, 0.1);
}

/* Bottom navigation (mobile only) */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bs-body-bg);
    border-top: 1px solid var(--bs-border-color);
    z-index: 1040;
    padding: 0.25rem 0;
    padding-bottom: env(safe-area-inset-bottom, 0.25rem);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-bottom-nav .nav {
    display: flex;
    justify-content: space-around;
}

.mobile-bottom-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.65rem;
    color: #6c757d;
    padding: 0.4rem 0.5rem;
    min-width: 60px;
    gap: 0.15rem;
}

.mobile-bottom-nav .nav-link i {
    font-size: 1.25rem;
}

.mobile-bottom-nav .nav-link.active {
    color: #0d6efd;
    font-weight: 600;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
    .time-slots {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .card:hover {
        transform: none;
    }

    .step-indicator {
        flex-direction: row;
        gap: 0.5rem;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 0.25rem;
    }

    .step-indicator .step span:not(.step-number) {
        font-size: 0.8rem;
    }

    .fc .fc-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .fc .fc-toolbar-title {
        font-size: 1rem;
    }

    .fc .fc-button {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    /* Touch-friendly pagination */
    .pagination .page-link {
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Filter buttons wrap on mobile */
    .btn-group {
        flex-wrap: wrap;
    }

    /* Better list items on mobile */
    .list-group-item .d-flex {
        flex-direction: column;
        gap: 0.5rem;
    }

    .list-group-item .badge {
        align-self: flex-start;
    }
}

/* Responsive - Mobile */
@media (max-width: 576px) {
    /* Show bottom nav, hide top nav links */
    .mobile-bottom-nav {
        display: block;
    }

    body {
        padding-bottom: 70px;
    }

    /* Smaller page title */
    h4 {
        font-size: 1.15rem;
    }

    /* Stats cards */
    .card-stats .card-body {
        padding: 0.75rem;
    }

    .card-stats .fs-2 {
        font-size: 1.5rem !important;
    }

    /* Step indicator compact */
    .step-indicator {
        gap: 0.25rem;
    }

    .step-indicator .step {
        font-size: 0.75rem;
        gap: 0.25rem;
    }

    .step-indicator .step .step-number {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    /* Time slots for small phones */
    .time-slots {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 0.4rem;
    }

    .time-slot {
        padding: 0.6rem 0.4rem;
        font-size: 0.85rem;
        min-height: 44px;
    }

    /* Touch-friendly buttons */
    .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-sm {
        min-height: 38px;
    }

    /* Empty state compact */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state i {
        font-size: 3rem;
    }

    /* Navbar brand compact */
    .navbar-brand {
        font-size: 1.1rem;
    }

    /* Full-width action buttons */
    .d-flex.gap-2 > .btn,
    .d-flex.flex-wrap.gap-2 > .btn,
    .d-flex.flex-wrap.gap-2 > a.btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Landing page hero */
    .display-4 {
        font-size: 1.75rem;
    }

    .lead {
        font-size: 1rem;
    }

    /* Quick actions stack */
    .d-flex.flex-wrap.gap-2 {
        flex-direction: column;
    }

    .d-flex.flex-wrap.gap-2 .btn {
        width: 100%;
    }

    /* Card body padding compact */
    .card-body {
        padding: 1rem;
    }

    /* Booking detail info row */
    .bg-body-secondary.rounded.p-3 {
        padding: 0.75rem !important;
    }

    .bg-body-secondary.rounded.p-3 .row .col-sm-6 {
        border-bottom: 1px solid #e9ecef;
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }

    .bg-body-secondary.rounded.p-3 .row .col-sm-6:last-child,
    .bg-body-secondary.rounded.p-3 .row .col-12:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
}
