/**
 * Imperio Gallístico
 * Estilos personalizados con colores de la Bandera Dominicana
 * Bootstrap 5
 */

:root {
    --rojo-dominicano: #CE1126;
    --azul-dominicano: #002D62;
    --blanco: #FFFFFF;
    --rojo-oscuro: #A00D1E;
    --azul-oscuro: #001F3F;
}

/* Header personalizado */
.bg-custom-header {
    background: linear-gradient(135deg, var(--rojo-dominicano) 0%, var(--azul-dominicano) 100%) !important;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--blanco) !important;
}

.logo-header {
    height: 103px;
    width: 103px;
    min-width: 103px;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    display: block !important;
    visibility: visible !important;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.brand-text {
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.navbar-brand i.bi-trophy-fill {
    font-size: 1.8rem;
    color: #FFD700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--blanco) !important;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

/* Botones personalizados */
.btn-primary {
    background-color: var(--azul-dominicano) !important;
    border-color: var(--azul-dominicano) !important;
}

.btn-primary:hover {
    background-color: var(--azul-oscuro) !important;
    border-color: var(--azul-oscuro) !important;
}

.btn-danger {
    background-color: var(--rojo-dominicano) !important;
    border-color: var(--rojo-dominicano) !important;
}

.btn-danger:hover {
    background-color: var(--rojo-oscuro) !important;
    border-color: var(--rojo-oscuro) !important;
}

/* Cards con gradiente */
.card-gradient-header {
    background: linear-gradient(135deg, var(--rojo-dominicano), var(--azul-dominicano));
    color: var(--blanco);
    padding: 1rem 1.5rem;
    border-radius: 0.375rem 0.375rem 0 0;
}

.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    background: #fff;
}

.card .ratio img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 1.75rem;
}

.card-footer {
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header h2 {
    color: var(--blanco);
    margin: 0;
}

/* Tablas personalizadas */
.table > thead {
    background: linear-gradient(135deg, var(--rojo-dominicano), var(--azul-dominicano)) !important;
    color: #FFFFFF !important;
}

.table > thead > tr {
    background: linear-gradient(135deg, var(--rojo-dominicano), var(--azul-dominicano)) !important;
}

.table > thead > tr > th {
    border-color: transparent !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    padding: 0.75rem !important;
    font-size: 0.95rem !important;
}

.table thead th {
    color: #FFFFFF !important;
    background: linear-gradient(135deg, var(--rojo-dominicano), var(--azul-dominicano)) !important;
}

.table > tbody > tr > td {
    color: #212529 !important;
    background-color: #fff !important;
    vertical-align: middle;
    padding: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.table > tbody > tr {
    background-color: #fff !important;
}

.table-hover > tbody > tr:hover {
    background-color: rgba(206, 17, 38, 0.05) !important;
}

.table-hover > tbody > tr {
    transition: transform 0.2s ease;
}

.table-hover > tbody > tr:hover {
    transform: translateY(-2px);
    background-color: rgba(206, 17, 38, 0.08) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
}

/* Enlaces y botones en tabla */
.table > tbody > tr > td a {
    color: inherit !important;
    text-decoration: none;
}

.table > tbody > tr > td .btn {
    color: #fff !important;
}

.table > tbody > tr > td .badge {
    color: #fff !important;
}

/* Miniaturas de fotos en tabla */
.table img.img-thumbnail {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 2px solid rgba(0, 45, 98, 0.2);
}

.table img.img-thumbnail:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 45, 98, 0.3);
    z-index: 10;
    position: relative;
}

/* Modal de imagen */
#imagenModal .modal-body img {
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Badges personalizados */
.badge.bg-primary {
    background-color: var(--azul-dominicano) !important;
}

.badge.bg-danger {
    background-color: var(--rojo-dominicano) !important;
}

.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: var(--azul-dominicano) !important;
}

/* Estadísticas con gradiente */
.stat-card {
    background: linear-gradient(135deg, var(--rojo-dominicano), var(--azul-dominicano));
    color: var(--blanco);
    padding: 2rem;
    border-radius: 0.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-card p {
    font-size: 1.1rem;
    margin: 0;
}

/* Formularios */
.form-label {
    color: var(--azul-dominicano);
    font-weight: 500;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--azul-dominicano);
    box-shadow: 0 0 0 0.25rem rgba(0, 45, 98, 0.25);
}

.form-control,
.form-select,
.form-control-file,
input[type="file"] {
    border-radius: 0.65rem;
    min-height: 2.75rem;
}

textarea.form-control {
    min-height: 6rem;
}

/* Alertas personalizadas */
.alert-custom-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-custom-error {
    background-color: #f8d7da;
    border-color: var(--rojo-dominicano);
    color: #721c24;
    border-left: 4px solid var(--rojo-dominicano);
}

/* Modales */
.modal-header {
    background: linear-gradient(135deg, var(--rojo-dominicano), var(--azul-dominicano));
    color: var(--blanco);
    border-bottom: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-title {
    color: var(--blanco) !important;
}

/* Fondo body */
body {
    background: linear-gradient(135deg, #F5F5F5 0%, #E8E8E8 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
}

.page-section {
    padding: 1.5rem 0;
}

/* Títulos */
h1, h2, h3, h4, h5, h6 {
    color: var(--azul-dominicano);
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Accesos rápidos */
.quick-access {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
}

.quick-access .btn {
    min-width: 200px;
    border-radius: 0.75rem;
    padding: 0.85rem 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive - Tablets y móviles grandes */
@media (max-width: 992px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .page-section {
        padding: 1rem 0;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .modal-dialog {
        margin: 1rem;
    }
    
    .modal-xl {
        max-width: calc(100% - 2rem);
    }
    
    /* Tablas responsive stack para tablets - solo si tienen data-label */
    .table-responsive table tbody td[data-label] {
        position: relative;
    }
    
    .table-responsive table tbody td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--azul-dominicano);
        display: block;
        margin-bottom: 0.25rem;
        font-size: 0.85rem;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }
    
    .table-responsive table tbody td[data-label] > * {
        display: block;
    }
}

/* Responsive - Tablets */
@media (max-width: 768px) {
    .logo-header {
        height: 86px;
        width: 86px;
        min-width: 86px;
    }
    
    .stat-card {
        padding: 1rem 0.75rem;
    }
    
    .stat-card h3 {
        font-size: 1.5rem;
        margin-bottom: 0.3rem;
    }
    
    .stat-card p {
        font-size: 0.8rem;
    }
    
    .quick-access {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .quick-access .btn {
        width: 100%;
        min-width: auto;
    }

    .card-body {
        padding: 1.25rem;
    }

    .table-responsive {
        border-radius: 0.75rem;
        box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
        -webkit-overflow-scrolling: touch;
    }

    .table {
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .form-control,
    .form-select {
        font-size: 0.95rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }
    
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* Modales responsivos */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-body .row {
        margin: 0;
    }
    
    .modal-body .col-md-4,
    .modal-body .col-md-6,
    .modal-body .col-md-8 {
        margin-bottom: 1rem;
    }
}

/* Responsive - Móviles */
@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1rem;
    }
    
    .brand-text {
        font-size: 0.9rem;
    }
    
    .logo-header {
        height: 78px;
        width: 78px;
        min-width: 78px;
    }
    
    .navbar-brand i.bi-trophy-fill {
        font-size: 1.5rem;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
    }

    body {
        background: linear-gradient(135deg, #fafafa 0%, #eaeaea 100%);
    }

    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .page-section {
        padding: 0.75rem 0;
    }

    .stat-card {
        padding: 0.75rem 0.5rem;
        margin-bottom: 0.5rem;
        border-radius: 0.4rem;
    }
    
    .stat-card h3 {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
        line-height: 1.2;
    }
    
    .stat-card p {
        font-size: 0.7rem;
        margin: 0;
        line-height: 1.3;
    }
    
    .stat-card p i {
        font-size: 0.65rem;
        margin-right: 0.2rem;
    }
    
    /* Reducir espaciado entre tarjetas en móvil */
    .row.g-4 {
        --bs-gutter-y: 0.5rem;
        --bs-gutter-x: 0.5rem;
    }

    .quick-access .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .quick-access .btn:last-child {
        margin-bottom: 0;
    }

    .card-body {
        padding: 1rem;
    }

    .card-gradient-header {
        padding: 0.75rem 1rem;
    }

    .card-title {
        font-size: 1.1rem;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem !important;
    }
    
    h2 {
        font-size: 1.25rem;
    }

    .table {
        font-size: 0.8rem;
        min-width: 100%;
    }
    
    /* Tablas en modo stack para móviles */
    .table-responsive {
        overflow-x: visible;
    }
    
    .table-responsive table {
        display: block;
        width: 100%;
    }
    
    .table-responsive thead {
        display: none;
    }
    
    .table-responsive tbody {
        display: block;
        width: 100%;
    }
    
    .table-responsive tbody tr {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
        padding: 1rem;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 0.5rem;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    
    .table-responsive tbody tr:last-child {
        margin-bottom: 0;
    }
    
    .table-responsive tbody td {
        display: block;
        width: 100%;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        text-align: left !important;
    }
    
    .table-responsive tbody td:last-child {
        border-bottom: none;
    }
    
    .table-responsive tbody td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--azul-dominicano);
        display: block;
        margin-bottom: 0.25rem;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }
    
    .table-responsive tbody td[data-label="Acciones"] {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        padding-top: 0.75rem;
    }
    
    .table-responsive tbody td[data-label="Acciones"]::before {
        margin-bottom: 0.5rem;
    }
    
    .table-responsive tbody td[data-label="Acciones"] .btn {
        width: 100%;
    }
    
    .table-responsive tbody td.text-center {
        text-align: left !important;
    }
    
    .table img.img-thumbnail {
        width: 80px !important;
        height: 80px !important;
        margin: 0 auto;
        display: block;
    }
    
    /* Formularios en móvil */
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 0.5rem;
        min-height: 2.5rem;
    }
    
    textarea.form-control {
        min-height: 5rem;
    }
    
    .btn {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Modales en móvil */
    .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    .modal-header {
        padding: 0.75rem 1rem;
    }
    
    .modal-title {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 0.75rem;
    }
    
    .modal-body .col-md-4,
    .modal-body .col-md-6,
    .modal-body .col-md-8 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .modal-body img {
        max-height: 200px;
        width: auto;
    }
    
    .modal-footer {
        padding: 0.75rem;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .modal-footer .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Galería de fotos en móvil */
    .col-md-3 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Inputs de búsqueda y filtros */
    .input-group {
        flex-direction: column;
    }
    
    .input-group .form-control,
    .input-group .form-select {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .input-group-text {
        width: 100%;
        justify-content: center;
    }
}


/* Tabla VS centrado */
.table .vs-cell {
    text-align: center;
    font-weight: bold;
    color: var(--rojo-dominicano);
    font-size: 1.2rem;
}

/* Iconos en botones */
.btn i {
    margin-right: 0.5rem;
}


/* Marketplace público */
.text-white-75 {
    color: rgba(255, 255, 255, 0.75) !important;
}

.store-hero {
    background: linear-gradient(135deg, var(--azul-dominicano), var(--rojo-dominicano));
    padding: 4rem 0;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.store-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.2), transparent 60%);
}

.store-hero-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.75rem;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.store-hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 45, 98, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--azul-dominicano);
}

.marketplace-card {
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.marketplace-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.08);
}

.marketplace-card-image {
    position: relative;
    padding-top: 65%;
    overflow: hidden;
}

.marketplace-card-image img,
.marketplace-card-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.marketplace-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f2f2;
    font-size: 2rem;
    color: #9aa0a6;
}

.marketplace-card-image .badge {
    position: absolute;
    top: 12px;
    right: 12px;
}

.marketplace-card-image .disponibilidad {
    top: auto;
    bottom: 12px;
    right: 12px;
}

.estado-nuevo { background-color: #0d6efd; }
.estado-seminuevo { background-color: #20c997; }
.estado-usado { background-color: #6c757d; }

.disponibilidad.disp-disponible { background-color: #198754; }
.disponibilidad.disp-reservado { background-color: #ffc107; color: #000; }
.disponibilidad.disp-vendido { background-color: #6c757d; }

.marketplace-card-body {
    padding: 1.5rem;
}

.marketplace-card-description {
    color: #5f6368;
    font-size: 0.95rem;
}

.marketplace-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--azul-dominicano);
}

.marketplace-card-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: #fafbfc;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 45, 98, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--azul-dominicano);
}

.marketplace-preview img {
    max-height: 220px;
    object-fit: cover;
}

.btn-store-access {
    background: linear-gradient(135deg, #198754, #20c997);
    border: none;
}

.btn-store-access:hover {
    filter: brightness(1.05);
}

.store-nav-btn {
    min-width: 140px;
    font-weight: 600;
}

.navbar .store-nav-btn i {
    margin-right: 0.25rem;
}

@media (max-width: 768px) {
    .store-hero {
        padding: 3rem 0;
    }

    .marketplace-card-body,
    .marketplace-card-footer {
        padding: 1rem;
    }

    body {
        background: #f7f8fb;
    }

    .card {
        border-radius: 1rem;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    }

    .stat-card {
        margin-bottom: 0.5rem;
        padding: 0.9rem 0.6rem;
        border-radius: 0.6rem;
    }

    .stat-card h3 {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }

    .stat-card p {
        font-size: 0.75rem;
    }

    .quick-access .btn {
        width: 100%;
        min-width: auto;
        border-radius: 0.85rem;
        padding: 0.85rem 1rem;
        font-size: 1rem;
        box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    }

    .quick-access .btn i {
        font-size: 1rem;
        margin-right: 0.4rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }

    h1,
    h2 {
        font-size: 1.5rem;
    }
}