/* ==========================================
   ESTILOS GLOBALES
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* ==========================================
   PÁGINA DE AUTENTICACIÓN
   ========================================== */

.auth-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Panel de Bienvenida */
.auth-welcome {
    flex: 1;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-welcome::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -100px;
    right: -100px;
}

.auth-welcome::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    bottom: -50px;
    left: -50px;
}

.welcome-content {
    text-align: center;
    z-index: 1;
}

.welcome-content h1 {
    font-size: 3.5em;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.welcome-content p {
    font-size: 1.3em;
    margin-bottom: 40px;
    opacity: 0.95;
}

.welcome-icons {
    display: flex;
    gap: 20px;
    justify-content: center;
    font-size: 3em;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Panel de Formulario */
.auth-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: white;
    position: relative;
}

.auth-form {
    width: 100%;
    max-width: 400px;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.auth-form.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 2em;
}

/* ==========================================
   FORMULARIOS
   ========================================== */

.form-group {
    margin-bottom: 20px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

.form-input:focus {
    outline: none;
    border-color: #4A90E2;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-input::placeholder {
    color: #999;
}

/* ==========================================
   BOTONES
   ========================================== */

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-link {
    background: none;
    border: none;
    color: #4A90E2;
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
    padding: 0;
    font-size: 0.95em;
    transition: color 0.3s ease;
}

.btn-link:hover {
    color: #357ABD;
}

/* ==========================================
   ALERTAS
   ========================================== */

.alert {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* ==========================================
   FOOTER
   ========================================== */

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 0.95em;
}

.form-footer button {
    margin-left: 5px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .auth-welcome {
        display: none;
    }

    .auth-form-container {
        flex: 1;
    }

    .welcome-content h1 {
        font-size: 2.5em;
    }
}

@media (max-width: 768px) {
    .auth-container {
        flex-direction: column;
    }

    .auth-welcome {
        display: flex;
        min-height: 200px;
    }

    .auth-form-container {
        padding: 30px 20px;
    }

    .auth-form {
        max-width: 100%;
    }

    .welcome-content h1 {
        font-size: 2em;
    }

    .welcome-content p {
        font-size: 1em;
    }

    .welcome-icons {
        font-size: 2em;
    }
}

/* ==========================================
   DASHBOARD - ESTILOS GENERALES
   ========================================== */

.navbar {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar h2 {
    font-size: 1.5em;
    margin: 0;
}

.navbar-buttons {
    display: flex;
    gap: 15px;
}

.navbar-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.navbar-btn:hover {
    background: white;
    color: #4A90E2;
}

/* ==========================================
   CONTENEDOR PRINCIPAL
   ========================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

.page-title {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #333;
    font-weight: 700;
}

/* ==========================================
   TABLA DE DATOS
   ========================================== */

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.data-table thead {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.data-table tbody tr:hover {
    background-color: #f5f5f5;
}

.data-table tbody tr.selected {
    background-color: #e3f2fd;
}

/* Tablas Responsivas (Mobile) */
@media (max-width: 768px) {
    .data-table, 
    .reservas-table, 
    .tickets-table, 
    .users-table,
    .items-table {
        border: 0;
    }

    .data-table thead, 
    .reservas-table thead, 
    .tickets-table thead, 
    .users-table thead,
    .items-table thead {
        display: none; /* Ocultar cabecera en mobile */
    }

    .data-table tr, 
    .reservas-table tr, 
    .tickets-table tr, 
    .users-table tr,
    .items-table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: #fff;
        padding: 10px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }

    .data-table td, 
    .reservas-table td, 
    .tickets-table td, 
    .users-table td,
    .items-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 10px 5px;
        border-bottom: 1px solid #eee;
    }

    .data-table td:last-child, 
    .reservas-table td:last-child, 
    .tickets-table td:last-child, 
    .users-table td:last-child,
    .items-table td:last-child {
        border-bottom: 0;
    }

    /* Mostrar etiqueta desde data-label */
    .data-table td::before, 
    .reservas-table td::before, 
    .tickets-table td::before, 
    .users-table td::before,
    .items-table td::before {
        content: attr(data-label);
        font-weight: bold;
        text-transform: uppercase;
        font-size: 0.85em;
        color: #666;
        margin-right: 15px;
        text-align: left;
    }
}

/* ==========================================
   TARJETAS
   ========================================== */

.card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-title {
    font-size: 1.3em;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
}

.card-text {
    color: #666;
    margin-bottom: 10px;
}

.card-price {
    font-size: 1.5em;
    color: #4A90E2;
    font-weight: 700;
    margin: 10px 0;
}

.grid-tours {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

/* ==========================================
   LOADING
   ========================================== */

/* Estilos de impresión para el reporte */
@media print {
    body * {
        visibility: hidden;
    }
    #reportModal, #reportModal *, #reportPrintArea, #reportPrintArea * {
        visibility: visible;
    }
    #reportModal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        background: white !important;
        display: block !important;
        padding: 0;
        margin: 0;
    }
    .modal-content {
        box-shadow: none !important;
        border: none !important;
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
    }
    .modal-header, .btn, .modal-close {
        display: none !important;
    }
    .data-table {
        box-shadow: none !important;
        border: 1px solid #eee !important;
    }
    .data-table thead {
        background: #f0f0f0 !important;
        color: black !important;
    }
    .data-table th, .data-table td {
        border: 1px solid #eee !important;
        color: black !important;
    }
}

.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.active {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #4A90E2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   COLORES DE ESTADO
   ========================================== */

.status-pagado {
    background-color: #d4edda;
    color: #155724;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.85em;
}

.status-pendiente {
    background-color: #fff3cd;
    color: #856404;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.85em;
}

.status-cancelado {
    background-color: #f8d7da;
    color: #721c24;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.85em;
}


/* ==========================================
   DASHBOARD
   ========================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    border: 2px solid transparent;
}

.dashboard-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: #4A90E2;
}

.dashboard-card .card-icon {
    font-size: 3.5em;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.dashboard-card:hover .card-icon {
    transform: scale(1.1);
}

.dashboard-card h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #333;
}

.dashboard-card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95em;
}

.card-action {
    display: inline-block;
    color: #4A90E2;
    font-weight: 600;
    transition: all 0.3s ease;
}

.dashboard-card:hover .card-action {
    color: #357ABD;
    transform: translateX(5px);
}

/* ==========================================
   NAVBAR MEJORADO
   ========================================== */

.navbar {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    padding: 3px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.navbar > div:first-child h2 {
    font-size: 1.8em;
    margin: 0;
    font-weight: 700;
}

.navbar-buttons {
    display: flex;
    gap: 15px;
}

.navbar-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.95em;
}

.navbar-btn:hover {
    background: white;
    color: #4A90E2;
    transform: translateY(-2px);
}

/* ==========================================
   CONTENEDOR
   ========================================== */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4px 30px;
    min-height: calc(100vh - 100px);
}

.page-title {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 40px;
    color: #333;
    font-weight: 700;
}

/* ==========================================
   SEARCH BAR
   ========================================== */

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #4A90E2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-btn {
    background: #4A90E2;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #357ABD;
    transform: translateY(-2px);
}

/* ==========================================
   SWITCH TOGGLE
   ========================================== */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #4A90E2;
}

input:focus + .slider {
    box-shadow: 0 0 1px #4A90E2;
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 24px;
}

.slider.round:before {
    border-radius: 50%;
}

/* ==========================================
   CARDS DE TOURS
   ========================================== */

.grid-tours.hide-images .tour-card-image {
    display: none;
}

.grid-tours.hide-images .tour-card {
    display: flex;
    flex-direction: column;
    min-height: auto;
}

.grid-tours.hide-images .tour-card-content {
    padding: 15px;
}

.tour-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.tour-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.tour-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
}

.tour-card-content {
    padding: 20px;
    margin: -10px;
}

.tour-card-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.tour-card-description {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 15px;
    min-height: 40px;
}

.tour-card-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.tour-card-price {
    font-size: 2em;
    color: #4A90E2;
    font-weight: 700;
}

.tour-card-btn {
    width: 100%;
    background: #4A90E2;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tour-card-btn:hover {
    background: #357ABD;
}

/* ==========================================
   TABLA DE RESERVAS
   ========================================== */

.reservas-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.reservas-table thead {
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
}

.reservas-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.reservas-table td {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.reservas-table tbody tr:hover {
    background-color: #f5f5f5;
}

.reservas-table tbody tr:hover td {
    cursor: pointer;
}

/* ==========================================
   MODAL
   ========================================== */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        text-align: center;
    }

    .navbar-buttons {
        margin-top: 15px;
        width: 100%;
    }

    .navbar-btn {
        flex: 1;
    }

    .container {
        padding: 20px 15px;
    }

    .page-title {
        font-size: 1.8em;
        margin-bottom: 20px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tour-card-image {
        height: 150px;
    }

    .search-bar {
        flex-direction: column;
    }

    .modal-content {
        padding: 20px;
    }
}



/* ==========================================
   TOUR INFO CARD
   ========================================== */

.tour-info-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border-left: 5px solid #4A90E2;
}

.tour-info-card h3 {
    font-size: 1.8em;
    color: #333;
    margin-bottom: 10px;
}

.tour-info-card p {
    color: #666;
    margin-bottom: 15px;
}

/* ==========================================
   RESERVATION FORM
   ========================================== */

.reservation-form {
    margin-top: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row.full {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.form-input,
.form-group select,
.form-group textarea {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

.form-input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4A90E2;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-group select {
    cursor: pointer;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ==========================================
   BOTONES SECUNDARIOS
   ========================================== */

.btn-secondary {
    background: #666;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-secondary:hover {
    background: #ff9626;
    transform: translateY(-2px);
}

/* ==========================================
   RESPONSIVE FORMS
   ========================================== */

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .reservation-form {
        padding: 20px;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-input,
    .search-btn {
        width: 100%;
    }
}