/**
 * Estilos Personalizados - Sistema de Gestão de Salas Hospitalares
 */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
}

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

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #0d6efd 0%, #0a58ca 100%);
    color: #e9ecef;
    min-height: 100vh;
    position: sticky;
    top: 0;
    padding-bottom: 2rem;
    transition: width 0.2s ease, transform 0.2s ease;
}

.sidebar .sidebar-brand {
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.sidebar-menu {
    padding: 0.5rem 0;
}

.sidebar-section {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.75rem 1rem 0.35rem 1rem;
}

.sidebar .nav-link {
    color: #e9ecef;
    padding: 0.65rem 1rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.sidebar .nav-link i {
    font-size: 1.1rem;
}

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

.sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.nav-text {
    white-space: nowrap;
}

.page-wrapper {
    background: #f5f7fb;
}

.topbar {
    height: 60px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.page-content {
    padding-left: 1rem;
    padding-right: 1rem;
    max-width: 100%;
}

@media (min-width: 768px) {
    .page-content {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .page-content {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

body.sidebar-collapsed .sidebar {
    width: 80px;
}

body.sidebar-collapsed .nav-text {
    display: none;
}

@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1050;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.25);
    }

    .page-wrapper {
        width: 100%;
    }
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    border: none;
}

/* Botões */
.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Tabelas */
.table {
    background-color: white;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    color: #495057;
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Formulários */
.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Alertas */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
}

/* Badges */
.badge {
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* Calendário */
.calendar-day {
    min-height: 100px;
    border: 1px solid #dee2e6;
    padding: 0.5rem;
    background-color: white;
    transition: background-color 0.2s;
}

.calendar-day:hover {
    background-color: #f8f9fa;
}

.calendar-day.today {
    background-color: #e7f3ff;
    border: 2px solid var(--primary-color);
}

.calendar-day.has-assignment {
    background-color: #d1e7dd;
}

/* FullCalendar - Datas indisponíveis */
.fc-event[data-tipo="indisponivel"] {
    opacity: 0.6;
}

.fc-bg-event[data-tipo="indisponivel"] {
    background-color: #e9ecef !important;
    opacity: 0.5;
}

/* Estilizar células de dias com eventos de background indisponível */
.fc-daygrid-day.fc-day-disabled {
    background-color: #f8f9fa;
    opacity: 0.6;
}

.fc-daygrid-day.fc-day-disabled .fc-daygrid-day-number {
    color: #6c757d;
    text-decoration: line-through;
}

/* Disponibilidades */
.availability-item {
    padding: 0.5rem;
    margin: 0.25rem 0;
    background-color: #e7f3ff;
    border-left: 3px solid var(--primary-color);
    border-radius: 0.25rem;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    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); }
}

/* Animações */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Notificações */
.notification-badge {
    position: relative;
}

.notification-badge::after {
    content: attr(data-count);
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Responsividade */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .topbar .input-group {
        max-width: 200px;
    }
}

@media (max-width: 576px) {
    .topbar .input-group {
        display: none;
    }
}

/* Loading Spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Utilidades */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Status badges */
.status-ativo {
    color: var(--success-color);
}

.status-inativo {
    color: var(--danger-color);
}
