.background-div {
    display: none !important;
}

.background-title {
    position: relative;
    top: 90px;
}

/* Estilo para el div de carga */
#loading {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    display: flex;
    flex-direction: column; /* Stack image and loader */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: auto;
    transition: opacity 0.5s ease, visibility 0.5s;
}

#loading.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Estilo para la imagen de carga */
.loading-image2 {
    width: 300px;
    max-width: 80%;
    height: auto;
    object-fit: contain;
    margin-bottom: 20px; /* Space between image and loader */
}

/* New Logic for SVG Loader */
.loader-container svg {
 width: 3.25em;
 transform-origin: center;
 animation: rotate4 2s linear infinite;
}

.loader-container circle {
 fill: none;
 stroke: hsl(214, 97%, 59%);
 stroke-width: 2;
 stroke-dasharray: 1, 200;
 stroke-dashoffset: 0;
 stroke-linecap: round;
 animation: dash4 1.5s ease-in-out infinite;
}

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

@keyframes dash4 {
 0% {
  stroke-dasharray: 1, 200;
  stroke-dashoffset: 0;
 }

 50% {
  stroke-dasharray: 90, 200;
  stroke-dashoffset: -35px;
 }

 100% {
  stroke-dashoffset: -125px;
 }
}

#content {
    display: none;
}

.modal-open .container-fluid,
.modal-open .container {
    filter: blur(4px);
    transition: filter 0.3s ease;
}

/* Table styling improvements */
table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

table thead tr:first-child th:first-child { border-top-left-radius: 12px; }
table thead tr:first-child th:last-child { border-top-right-radius: 12px; }
table tbody tr:last-child td:first-child { border-bottom-left-radius: 12px; }
table tbody tr:last-child td:last-child { border-bottom-right-radius: 12px; }

/* Background Image Section - Global */
.background-image {
    background-image: url('../media/Images/BANNER-MEFIA-PAGOPAYMENT (1).jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    margin: 0;
    padding: 0;
    width: 100vw;
    min-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0; /* Lower than content but higher than body */
    pointer-events: none; /* Critical: Ensure clicks pass through the background container */
}

/* Banner específico para inicio */
.background-image.inicio-banner {
    background-image: url('../media/Images/BANNER-MEFIA-BIENVENIDA\ \(1\).jpg');
}

/* Base resets for full height layouts */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
}

:root {
    --card-internal-translate-x: 0px;
    --card-internal-translate-y: 0px;
}

/* Cards Internal - General Formatting */
.card-internal, .card-internal2 {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    width: 100%;
    max-width: 1100px;
    position: relative;
    z-index: 10; /* Higher than background but below overlays */
    pointer-events: auto !important; /* Force clickable */
}

/* Facturas Page Specific - But kept in Site for legacy reasons (will be cleaned in facturas.css) */
/* Moving specific facturas styling strictly to facturas.css to avoid conflicts */
/* Kept generic responsive helpers */

/* HR Text with stylish lines */
.hr-text {
    display: flex;
    align-items: center;
    text-align: center;
    color: #6c757d;
    margin: 2rem 0;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.hr-text::before,
.hr-text::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.hr-text::before { margin-right: 1rem; }
.hr-text::after { margin-left: 1rem; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card-internal, .card-internal2 {
        padding: 1.5rem;
        border-radius: 20px;
        width: 95%;
    }
    
    .background-title {
        top: 60px;
        font-size: 1.5rem;
    }
}

@media (max-width: 576px) {
    .card-internal, .card-internal2 {
        padding: 1.25rem;
        border-radius: 16px;
        width: 92%;
    }

    .background-image {
        background-attachment: scroll; /* Better performance on mobile */
    }
}

/* Utilities for image positioning */
.image-cover { background-size: cover !important; }
.image-contain { background-size: contain !important; }

/* Flex/Grid Alignment Utilities */
.flex-center { display: flex; justify-content: center; align-items: center; }
.flex-column-center { display: flex; flex-direction: column; justify-content: center; align-items: center; }

/* Layout Fixes */
.Layouts {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#kt_content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Extra Large Devices (Large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .background-div {
        left: 10%;
        width: 80%;
        height: 42%;
        border-bottom-left-radius: 4.5rem;
        border-bottom-right-radius: 4.5rem;
    }

    .background-title {
        top: 90px;
        font-size: 2rem;
    }

    /* Responsive adjust if needed */

    .background-image {
        height: calc(100vh - 60px);
        min-height: calc(100vh - 60px);
        border-radius: 0;
        padding: 0;
        margin: 0;
    }

    .card-internal {
        width: 41%;
        max-width: 473px;
        height: auto;
        min-height: auto;
        border-radius: 2rem;
        padding: 0rem;
        margin: 15vh auto;
        transform: translate(var(--card-internal-translate-x), var(--card-internal-translate-y));
    }

    .card-internal2 {
        height: auto;
        min-height: 60vh;
        border-radius: 2rem;
    }

    .image-response {
        width: 40%;
    }
}
/* Footer Overlap Fix */
footer, .footer, #kt_footer {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    z-index: 1 !important;
    background-color: #1a1a1a !important;
    padding: 1rem 0 !important;
    margin-top: auto !important;
}

/* Ensure content pushes footer down */
body, html {
    height: 100%;
}
