/* --- DISEÑO ELEGANTE Y RESPONSIVO PARA SAMARIA --- */

/* 1. Configuración General y Variables */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #1c3d5a;
    --accent-color: #ffc107;
    --light-bg: #f8f9fa;
    --success-color: #198754;
    --danger-color: #dc3545;
    --gray-color: #6c757d;
    --sidebar-width: 260px;
    --header-height: 60px;
}

body {
    background-color: var(--light-bg);
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    color: #444;
}

body.owner-layout {
    padding-bottom: 70px;
}

/* 2. Layout Principal (Sidebar y Header) */
.app-wrapper {
    display: flex;
}

/* --- SIDEBAR REDISEÑADO CON EFECTO GLASSMORPHISM --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: rgba(10, 25, 41, 0.75);
    /* Fondo oscuro semitransparente */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 1rem;
    transition: transform 0.3s ease;
    z-index: 1100;
}

.main-content-wrapper {
    flex-grow: 1;
    transition: margin-left 0.3s ease;
    width: 100%;
}

body.owner-layout .page-container {
    padding: 1.5rem;
}

.mobile-header {
    height: var(--header-height);
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1050;
}

/* 3. Estilos Responsivos para el Layout */
@media (min-width: 992px) {
    body.owner-layout .main-content-wrapper {
        margin-left: var(--sidebar-width);
    }

    .mobile-header,
    .navbar-owner {
        display: none !important;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    body.sidebar-open .main-content-wrapper::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1099;
    }

    body.owner-layout .page-container {
        padding-top: calc(var(--header-height) + 1rem);
    }
}

/* 4. Componentes Rediseñados */

/* Navegación (Sidebar y Navbar Mobile) */
.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar .nav-link i {
    margin-right: 1rem;
    font-size: 1.2rem;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

.navbar-owner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-top: 1px solid #dee2e6;
    z-index: 1000;
}

.navbar-owner .nav-link {
    color: var(--gray-color);
    text-align: center;
    padding: 0.5rem 0;
}

.navbar-owner .nav-link.active {
    color: var(--primary-color);
}

.navbar-owner .nav-link i {
    font-size: 1.5rem;
}

/* Tarjetas, Formularios, Botones */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

.form-control,
.form-select,
.form-floating>.form-control {
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    border-color: var(--primary-color);
}

.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
}

.btn-lg {
    padding: 0.8rem 1.5rem;
}

.fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1050;
    cursor: pointer;
    transition: transform 0.2s;
}

.fab:hover {
    transform: scale(1.1);
}

/* --- ESTILOS PARA PÁGINAS PÚBLICAS COLORIDAS --- */

.public-page-wrapper {
    min-height: 100vh;
    width: 100%;
    background-image: linear-gradient(rgba(0, 20, 40, 0.6), rgba(0, 20, 40, 0.6)), url('https://images.unsplash.com/photo-1590523741831-ab7e8b8f9c7f?q=80&w=2070&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #fff;
    padding: 1.5rem;
}

.search-content-box {
    background: rgba(10, 25, 41, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem;
}

.search-content-box .form-control {
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    color: #333;
}

/* CORRECCIÓN PARA PLACEHOLDER EN SAFARI/IOS */
.search-content-box .form-control::placeholder {
    color: var(--gray-color);
    opacity: 0.8;
}

.search-content-box h1,
.search-content-box p,
.search-content-box h2 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.public-content-container {
    background-color: var(--light-bg);
    color: #444;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

/* --- ESTILOS COMPLETOS Y CORREGIDOS --- */

/* Loader Global (Spinner) */
.loader-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

/* Calendario Detallado */
.col-lg-1-7 {
    flex: 0 0 auto;
    width: 14.28571429%;
}

.calendar-day,
.calendar-day-empty {
    min-height: 120px;
    transition: background-color 0.2s;
}

.calendar-day:hover {
    background-color: #e9ecef;
}

/* Galería de Imágenes en Formulario */
.image-preview-item {
    position: relative;
    padding: 5px;
}

.image-preview-item .img-thumbnail {
    cursor: pointer;
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.cover-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background-color: var(--accent-color);
    color: var(--secondary-color);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: bold;
    pointer-events: none;
}

.remove-image-btn {
    position: absolute;
    top: 0;
    right: 0;
}

/* Modal Visor de Imágenes */
#imageViewerModal .modal-content {
    background-color: rgba(0, 0, 0, 0.85);
}

#imageViewerModal .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Otros Componentes */
.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
}