/**
 * Puerto Custodia S.A. - Core Stylesheet
 * Developed by BinariaOS (https://binariaos.com.py)
 */

/* 1. CSS VARIABLES & DESIGN SYSTEM */
:root {
    --primary-blue: #0b3c5d;
    --primary-blue-rgb: 11, 60, 93;
    --navy-dark: #07253b;
    --accent-orange: #ff7a00;
    --accent-orange-hover: #e06900;
    --accent-orange-rgb: 255, 122, 0;
    --pure-white: #ffffff;
    --light-bg: #f4f7fa;
    --slate-text: #475569;
    --dark-text: #1e293b;
    --border-color: #e2e8f0;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* 2. GENERAL RESET & TYPOGRAPHY */
html, body {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
html::-webkit-scrollbar, body::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

body {
    font-family: var(--font-body);
    background-color: var(--light-bg);
    color: var(--dark-text);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .font-title {
    font-family: var(--font-heading);
    color: var(--primary-blue);
    font-weight: 700;
}

.text-navy { color: var(--primary-blue) !important; }
.text-accent { color: var(--accent-orange) !important; }
.text-slate { color: var(--slate-text) !important; }
.bg-navy { background-color: var(--primary-blue) !important; }
.bg-navy-dark { background-color: var(--navy-dark) !important; }
.bg-accent { background-color: var(--accent-orange) !important; }

/* 3. BUTTONS & UI ELEMENTS */
.btn-accent {
    background-color: var(--accent-orange);
    border-color: var(--accent-orange);
    color: var(--pure-white) !important;
    font-weight: 600;
    transition: var(--transition-normal);
}
.btn-accent:hover, .btn-accent:focus {
    background-color: var(--accent-orange-hover);
    border-color: var(--accent-orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 122, 0, 0.3);
}

.btn-outline-navy {
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    font-weight: 600;
    transition: var(--transition-normal);
}
.btn-outline-navy:hover {
    background-color: var(--primary-blue);
    color: var(--pure-white);
    transform: translateY(-2px);
}

.btn-white-premium {
    background-color: var(--pure-white);
    border: 2px solid var(--pure-white);
    color: var(--navy-dark) !important;
    font-weight: 600;
    transition: var(--transition-normal);
}
.btn-white-premium:hover, .btn-white-premium:focus {
    background-color: transparent;
    color: var(--pure-white) !important;
    border-color: var(--pure-white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.btn-outline-white-premium {
    background-color: transparent;
    border: 2px solid var(--pure-white);
    color: var(--pure-white) !important;
    font-weight: 600;
    transition: var(--transition-normal);
}
.btn-outline-white-premium:hover, .btn-outline-white-premium:focus {
    background-color: var(--pure-white);
    color: var(--navy-dark) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.15);
}

.border-bottom-accent {
    border-bottom: 3px solid var(--accent-orange);
    width: 60px;
}

/* 4. LAYOUT COMPONENT: HEADER */
.top-bar {
    font-size: 13px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.main-header {
    background-color: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.main-header.scrolled {
    padding-top: 5px;
    padding-bottom: 5px;
    box-shadow: var(--shadow-md);
}

.navbar-brand img {
    height: 50px;
    transition: var(--transition-normal);
}
.main-header.scrolled .navbar-brand img {
    height: 40px;
}

.brand-title {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-blue);
    line-height: 1.1;
    font-family: var(--font-heading);
}
.brand-subtitle {
    display: block;
    font-size: 11px;
    color: var(--slate-text);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-link {
    color: var(--dark-text);
    font-weight: 500;
    font-size: 15px;
    padding: 0.5rem 1rem !important;
    position: relative;
    transition: var(--transition-fast);
}
.nav-link:hover, .nav-link.active {
    color: var(--primary-blue);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--accent-orange);
    transition: var(--transition-normal);
    transform: translateX(-50%);
}
.nav-link:hover::after, .nav-link.active::after {
    width: 60%;
}

/* 5. HOMEPAGE & COMPONENT STYLING */

/* Hero Banner */
.hero-section {
    position: relative;
    height: calc(100vh - 120px);
    min-height: 500px;
    display: flex;
    align-items: center;
    background-color: var(--primary-blue);
    background-position: center center;
    background-size: cover;
    color: var(--pure-white);
}

/* Hero Carousel Slider */
.hero-carousel {
    position: relative;
    height: calc(100vh - 120px);
    min-height: 500px;
    background-color: var(--primary-blue);
}
.hero-carousel .carousel-inner {
    height: 100%;
}
.hero-carousel .carousel-item {
    height: 100%;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
}
.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    z-index: 10;
    width: 60px;
    opacity: 0.5;
    transition: var(--transition-normal);
}
.hero-carousel .carousel-control-prev:hover,
.hero-carousel .carousel-control-next:hover {
    opacity: 1;
}
.hero-carousel .carousel-indicators {
    z-index: 10;
    margin-bottom: 2rem;
}
.hero-carousel .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 6px;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    transition: var(--transition-normal);
}
.hero-carousel .carousel-indicators button.active {
    background-color: var(--accent-orange);
    transform: scale(1.2);
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(7, 37, 59, 0.9) 0%, rgba(11, 60, 93, 0.6) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-content h1 {
    color: var(--pure-white);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }
}

.hero-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Feature Cards & Grids */
.premium-card {
    background-color: var(--pure-white);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    transition: var(--transition-normal);
    height: 100%;
}

.premium-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
    border-color: rgba(255, 122, 0, 0.2);
}

.card-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background-color: rgba(11, 60, 93, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary-blue);
    font-size: 28px;
    transition: var(--transition-normal);
}

.premium-card:hover .card-icon-wrapper {
    background-color: var(--accent-orange);
    color: var(--pure-white);
}

/* Page Section Headers */
.section-title-wrapper {
    margin-bottom: 3rem;
}
.section-title {
    font-size: 2.2rem;
    position: relative;
    padding-bottom: 12px;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background-color: var(--accent-orange);
}
.section-title-center::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Entrance Animations */
.animate-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 6. COMPONENT STYLING: NEWS & BLOG */
.news-card {
    background-color: var(--pure-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
    border: none;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.news-img-wrapper {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.news-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.news-card:hover .news-img {
    transform: scale(1.08);
}

.news-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background-color: var(--accent-orange);
    color: var(--pure-white);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.news-date {
    font-size: 13px;
    color: var(--slate-text);
}

.news-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.news-card-title a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition-fast);
}
.news-card-title a:hover {
    color: var(--accent-orange);
}

/* Single News Layout */
.single-news-content {
    background-color: var(--pure-white);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: var(--shadow-md);
}
@media(max-width:768px) {
    .single-news-content {
        padding: 1.5rem;
    }
}
.single-news-body p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--dark-text);
    margin-bottom: 1.5rem;
}

/* 7. COMPONENT STYLING: GALLERY & LIGHTBOX */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 60, 93, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: var(--transition-normal);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Custom Lightbox Modal */
.custom-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(7, 37, 59, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.lightbox-content {
    max-width: 85%;
    max-height: 80%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    object-fit: contain;
}

.lightbox-caption {
    color: var(--pure-white);
    margin-top: 1rem;
    text-align: center;
    max-width: 80%;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--pure-white);
    font-size: 40px;
    cursor: pointer;
    transition: var(--transition-fast);
}
.lightbox-close:hover {
    color: var(--accent-orange);
}

/* 8. OPERATIONS / PROYECTOS CARD */
.operation-card {
    background-color: var(--pure-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: none;
    margin-bottom: 2rem;
}
.operation-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

/* 9. FLOATING ACTIONS */
.floating-whatsapp {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: var(--pure-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    text-decoration: none;
    transition: var(--transition-normal);
    animation: whatsapp-pulse 2s infinite;
}

.floating-whatsapp:hover {
    transform: scale(1.1);
    color: var(--pure-white);
}

@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* 10. SOCIAL MEDIA & FOOTER styling */
.footer-logo {
    height: 45px;
}

.footer-menu a {
    color: var(--slate-text);
    text-decoration: none;
    transition: var(--transition-fast);
}
.footer-menu a:hover {
    color: var(--accent-orange);
    padding-left: 5px;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(11, 60, 93, 0.08);
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: var(--transition-normal);
}
.social-link:hover {
    background-color: var(--accent-orange);
    color: var(--pure-white);
    transform: translateY(-3px);
}

/* 11. ADMIN BACKOFFICE LAYOUT OVERRIDES */
.admin-login-body {
    background-color: var(--primary-blue);
    background-image: linear-gradient(135deg, var(--navy-dark) 0%, var(--primary-blue) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.admin-login-card {
    width: 100%;
    max-width: 420px;
    background: var(--pure-white);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
}

.admin-dashboard-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background-color: var(--primary-blue);
    color: var(--pure-white);
    flex-shrink: 0;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.7);
    padding: 0.75rem 1.5rem !important;
}

.admin-sidebar .nav-link::after {
    display: none;
}

.admin-sidebar .nav-link:hover, 
.admin-sidebar .nav-link.active {
    color: var(--pure-white);
    background-color: rgba(255, 255, 255, 0.08);
}

.admin-sidebar .nav-link.active {
    border-left: 4px solid var(--accent-orange);
}

.admin-main-content {
    flex-grow: 1;
    background-color: #f8fafc;
    padding: 2rem;
}

.admin-top-nav {
    background-color: var(--pure-white);
    border-bottom: 1px solid var(--border-color);
}

.admin-stat-card {
    border-radius: 8px;
    background-color: var(--pure-white);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

/* Image previews on upload */
.admin-img-preview {
    max-height: 120px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    margin-top: 10px;
    display: block;
}

/* Map responsive container */
.map-responsive {
    overflow: hidden;
    padding-bottom: 56.25%;
    position: relative;
    height: 0;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.map-responsive iframe {
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    position: absolute;
}

/* 12. RESPONSIVE MEDIA QUERIES FOR MEDIUM SCREEN SIZES */
@media (min-width: 992px) and (max-width: 1250px) {
    .nav-link {
        font-size: 13.5px;
        padding: 0.5rem 0.5rem !important;
    }
    .navbar-brand img {
        height: 38px;
    }
    .brand-title {
        font-size: 14px;
    }
    .brand-subtitle {
        font-size: 9px;
    }
    .btn-accent {
        padding: 0.35rem 0.75rem !important;
        font-size: 13px;
        margin-left: 0.25rem;
    }
}

/* 13. PRELOADER SCREEN STYLING */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--pure-white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999; /* Highest priority overlay */
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
}

.preloader-logo {
    width: 48px;
    height: 48px;
    position: absolute;
    animation: preloader-pulse 2s infinite ease-in-out;
}

.preloader-spinner {
    width: 96px;
    height: 96px;
    border: 3px solid rgba(11, 60, 93, 0.08);
    border-top: 3px solid var(--accent-orange);
    border-radius: 50%;
    animation: preloader-spin 1s infinite linear;
}

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

@keyframes preloader-pulse {
    0%, 100% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.15); opacity: 1; }
}


