/* ========================================
   ADMIN CUSTOM CSS - Sistema de Gestión Hotelera
   Fecha: 08 de Agosto 2025
   ======================================== */

/* ===============================
   VARIABLES CSS Y RESET
   =============================== */
:root {
    --primary-color: #007bff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* ===============================
   UTILIDADES GENERALES
   =============================== */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.border-dashed {
    border-style: dashed !important;
}

/* ===============================
   ESTADOS Y BADGES PERSONALIZADOS
   =============================== */
.badge-estado {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
}

.badge-pendiente {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.badge-confirmado {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.badge-ocupado {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.badge-disponible {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-limpieza {
    background-color: #e2e3e5;
    color: #383d41;
    border: 1px solid #d6d8db;
}

.badge-mantenimiento {
    background-color: #fdf2e9;
    color: #b86800;
    border: 1px solid #fad5a5;
}

/* ===============================
   CARDS MEJORADOS
   =============================== */
.card-hover {
    transition: all 0.3s ease;
}

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

.card-stat {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.card-stat .card-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.card-stat .card-text {
    opacity: 0.9;
    font-size: 0.875rem;
}

/* ===============================
   HABITACIONES - GRID Y CARDS
   =============================== */
.habitacion-card {
    min-height: 120px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.habitacion-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.habitacion-card:hover::before {
    transform: scaleX(1);
}

.habitacion-card.disponible {
    border-left: 4px solid var(--success-color);
}

.habitacion-card.ocupado {
    border-left: 4px solid var(--danger-color);
}

.habitacion-card.pendiente {
    border-left: 4px solid var(--warning-color);
}

.habitacion-card.limpieza {
    border-left: 4px solid var(--info-color);
}

.habitacion-card.mantenimiento {
    border-left: 4px solid var(--dark-color);
}

/* ===============================
   NOTIFICACIONES PERSONALIZADAS
   ======================================= */
.notification-item {
    transition: all 0.2s ease;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.notification-item:hover {
    background-color: var(--light-color);
    cursor: pointer;
}

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

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
}

.notification-icon.urgente {
    background-color: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.notification-icon.normal {
    background-color: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

/* ===============================
   FORMULARIOS MEJORADOS
   =============================== */
.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control.is-invalid:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control.is-valid:focus {
    border-color: var(--success-color);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

/* Campos de búsqueda */
.search-input {
    position: relative;
}

.search-input::after {
    content: "\f002";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
}

/* ===============================
   TABLAS RESPONSIVAS MEJORADAS
   =============================== */
.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table thead th {
    background-color: var(--light-color);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.025rem;
}

.table tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.table .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    margin: 0.125rem;
}

/* FIXED: Tamaño controlado de iconos en tablas */
.table .btn i {
    font-size: 0.875rem !important;
    width: 1rem;
    text-align: center;
}

.table .btn-sm i {
    font-size: 0.75rem !important;
    width: 0.875rem;
    text-align: center;
}

/* Asegurar que los iconos no se agranden desproporcionalmente */
.fas, .far, .fab {
    font-size: inherit;
    vertical-align: baseline;
}

/* ===============================
   BOTONES PERSONALIZADOS
   =============================== */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.btn-action i {
    font-size: 1rem;
}

.btn-action:hover {
    transform: scale(1.1);
}

.btn-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
}

.btn-floating:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* ===============================
   DASHBOARD ESPECÍFICO
   =============================== */
.dashboard-stat {
    text-align: center;
    padding: 1.5rem;
}

.dashboard-stat .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.dashboard-stat .stat-label {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    opacity: 0.8;
}

.dashboard-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

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

/* ===============================
   ALERTAS Y MENSAJES
   =============================== */
.alert-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===============================
   UTILIDADES DE CAJA
   =============================== */
.caja-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.caja-status.abierta {
    background-color: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
    border: 2px solid rgba(40, 167, 69, 0.2);
}

.caja-status.cerrada {
    background-color: rgba(108, 117, 125, 0.1);
    color: var(--dark-color);
    border: 2px solid rgba(108, 117, 125, 0.2);
}

.caja-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
}

/* ===============================
   LOADING Y SPINNERS
   =============================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-custom {
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid var(--light-color);
    border-top: 0.25rem solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===============================
   MEDIA QUERIES - RESPONSIVIDAD
   =============================== */
@media (max-width: 768px) {
    .habitacion-card {
        min-height: 100px;
    }

    .dashboard-stat .stat-number {
        font-size: 2rem;
    }

    .btn-floating {
        bottom: 1rem;
        right: 1rem;
        width: 3rem;
        height: 3rem;
    }

    .alert-floating {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

@media (max-width: 576px) {
    .table-responsive {
        border-radius: 0;
    }

    .dashboard-stat {
        padding: 1rem;
    }

    .dashboard-stat .stat-number {
        font-size: 1.75rem;
    }
}

/* ===============================
   MODO OSCURO (OPCIONAL)
   =============================== */
@media (prefers-color-scheme: dark) {
    .dashboard-card {
        background: #2c3e50;
        color: #ecf0f1;
    }

    .table thead th {
        background-color: #34495e;
        color: #ecf0f1;
    }

    .form-control {
        background-color: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
}

/* ===============================
   PRINT STYLES
   =============================== */
@media print {
    .btn,
    .btn-group,
    .pagination,
    .navbar,
    .sidebar,
    .alert {
        display: none !important;
    }

    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }

    .table {
        border-collapse: collapse !important;
    }

    .table,
    .table th,
    .table td {
        border: 1px solid #000 !important;
    }
}

/* ===============================
   TAILWIND CSS CLASSES COMPATIBILITY
   Para iconos SVG que usan clases Tailwind
   =============================== */

/* URGENTE: Forzar tamaño de iconos SVG inmediatamente */
svg.w-5, svg.h-5, .w-5.h-5 {
    width: 1.25rem !important;
    height: 1.25rem !important;
    max-width: 1.25rem !important;
    max-height: 1.25rem !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

/* Forzar para todos los SVG en general */
svg {
    max-width: 2rem !important;
    max-height: 2rem !important;
}

/* Tamaños de width y height de Tailwind */
.w-4, .w-4 svg {
    width: 1rem !important; /* 16px */
    max-width: 1rem !important;
}

.h-4, .h-4 svg {
    height: 1rem !important; /* 16px */
    max-height: 1rem !important;
}

.w-5, .w-5 svg {
    width: 1.25rem !important; /* 20px */
    max-width: 1.25rem !important;
}

.h-5, .h-5 svg {
    height: 1.25rem !important; /* 20px */
    max-height: 1.25rem !important;
}

.w-6, .w-6 svg {
    width: 1.5rem !important; /* 24px */
    max-width: 1.5rem !important;
}

.h-6, .h-6 svg {
    height: 1.5rem !important; /* 24px */
    max-height: 1.5rem !important;
}

/* SVG icons en general */
svg {
    display: inline-block;
    vertical-align: middle;
}

/* Específicamente para botones con SVG */
.btn svg {
    width: 1rem !important;
    height: 1rem !important;
    max-width: 1rem !important;
    max-height: 1rem !important;
}

.btn-sm svg {
    width: 0.875rem !important;
    height: 0.875rem !important;
    max-width: 0.875rem !important;
    max-height: 0.875rem !important;
}

.btn-lg svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    max-width: 1.25rem !important;
    max-height: 1.25rem !important;
}

/* Para enlaces y elementos de navegación */
a svg, .nav-link svg {
    width: 1.125rem !important;
    height: 1.125rem !important;
    max-width: 1.125rem !important;
    max-height: 1.125rem !important;
}

/* Para íconos en tablas */
.table svg {
    width: 1rem !important;
    height: 1rem !important;
    max-width: 1rem !important;
    max-height: 1rem !important;
}

/* Para notificaciones y alertas */
.notification svg, .alert svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    max-width: 1.25rem !important;
    max-height: 1.25rem !important;
}
