/* public/css/portafolio.css */

/* ======================================================== */
/* ==   CORE: FONTS & VARS PREFS                         == */
/* ======================================================== */
@font-face {
  font-family: 'dflip';
  src:  url('../dflip/fonts/dflip.woff?r8d732') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

/* ======================================================== */
/* ==   HERO SECTION (Premium Standard)                  == */
/* ======================================================== */
.hero-portfolio {
    position: relative;
    height: 60vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    margin-bottom: -4rem; /* Overlap with next section */
    z-index: 1;
}

/* Background Wrapper */
.hero-bg-wrapper {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
}

.hero-bg-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-portfolio-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    /* Brand Gradient Overlay - Copied from Home Page */
    background: linear-gradient(
        135deg,
        hsla(260, 80%, 10%, 0.85) 0%,
        hsla(260, 80%, 18%, 0.6) 50%,
        hsla(190, 80%, 50%, 0.2) 100%
    );
    backdrop-filter: blur(2px);
    mix-blend-mode: multiply; /* Optional: better blending with image */
}

.hero-content {
    z-index: 2;
    position: relative;
}

.hero-content h1 {
    font-family: var(--second-font);
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--white-color);
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: var(--h3-font-size);
    max-width: 600px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Hero Icons Row */
.hero-icons-row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.hero-icons-row i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    cursor: default;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.3));
}

.hero-icons-row i:hover {
    color: var(--second-color); /* Bright Cyan pop */
    transform: translateY(-5px) scale(1.1);
    filter: drop-shadow(0 0 10px var(--second-color));
}

/* ======================================================== */
/* ==   SECCIÓN FLIPBOOK (Glass Container)               == */
/* ======================================================== */
.portfolio-section {
    position: relative;
    padding-top: 8rem; /* Space for hero overlap */
    padding-bottom: 5rem;
    z-index: 10;
}

.flipbook-container {
    background: var(--card-bg-color); /* Fallback */
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px;
    border-radius: 24px;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.5) inset;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.4s ease;
}

body.dark-theme .flipbook-container {
    background: rgba(30, 30, 40, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

/* Flipbook Override Controls (Matching Theme) */
.df-ui-btn, .df-ui-zoom-in, .df-ui-zoom-out, .df-ui-page-mode, 
.df-ui-download, .df-ui-share, .df-ui-fullscreen, 
.df-ui-start, .df-ui-end, .df-ui-next, .df-ui-prev {
    background: rgba(255,255,255,0.9) !important;
    color: var(--title-color) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05) !important;
    backdrop-filter: blur(5px);
}

body.dark-theme .df-ui-btn, body.dark-theme .df-ui-zoom-in, 
body.dark-theme .df-ui-zoom-out, body.dark-theme .df-ui-next, 
body.dark-theme .df-ui-prev {
    background: rgba(30,30,35,0.9) !important;
    color: var(--white-color) !important;
    border-color: rgba(255,255,255,0.1) !important;
}

.df-ui-btn:hover, .df-ui-next:hover, .df-ui-prev:hover {
    background: var(--first-color) !important;
    color: white !important;
    transform: translateY(-2px);
}

/* ======================================================== */
/* ==   CATEGORIES GRID (Premium Glass Cards)            == */
/* ======================================================== */
.category-section {
    padding: 5rem 0;
    position: relative;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* New Premium Card Style */
.premium-category-card {
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.dark-theme .premium-category-card {
    background: rgba(30, 30, 40, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.premium-category-card:hover {
    transform: translateY(-10px) scale(1.02);
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--first-color);
    box-shadow: 
        0 20px 40px rgba(252, 0, 168, 0.15),
        0 0 0 1px var(--first-color);
}

body.dark-theme .premium-category-card:hover {
    background: rgba(40, 40, 50, 0.9);
}

/* Floating Icon Styling */
.icon-floating-container {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(252, 0, 168, 0.1), rgba(0, 217, 255, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    transition: all 0.5s ease;
    border: 1px solid rgba(255,255,255,0.5);
}

.category-icon {
    font-size: 2.5rem;
    background: var(--gradient-color);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.5s ease;
}

/* Icon Hover Effect */
.premium-category-card:hover .icon-floating-container {
    background: var(--gradient-color);
    transform: rotate(10deg) scale(1.1);
    box-shadow: 0 10px 20px rgba(252, 0, 168, 0.3);
    border-color: transparent;
}

.premium-category-card:hover .category-icon {
    -webkit-text-fill-color: white; /* Make icon white on gradient bg */
    transform: scale(0.9);
}

.category-title {
    font-family: var(--second-font);
    font-size: 1.5rem; /* ~24px */
    color: var(--title-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.category-description {
    font-size: 0.95rem;
    color: var(--text-color-light);
    line-height: 1.6;
}

/* ======================================================== */
/* ==   UNIVERSAL GLASS MODAL (The Standard)             == */
/* ======================================================== */

/* 1. Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    backdrop-filter: blur(8px); /* Background Blur */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* 2. Modal Content - The "Neon Border" Trick */
.modal-content {
    position: relative;
    width: 90%;
    max-width: 650px;
    padding: 2.5rem;
    border-radius: 24px;
    
    /* Double Background for Gradient Border */
    background: 
        linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)) padding-box,
        var(--gradient-color) border-box;
    border: 2px solid transparent; /* Transparent width for the gradient to show */
    
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 
        0 25px 50px rgba(0,0,0,0.15),
        0 10px 30px rgba(252, 0, 168, 0.15); /* Tinted shadow */
    
    transform: translateY(50px) scale(0.95);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

body.dark-theme .modal-content {
    background: 
        linear-gradient(rgba(30, 30, 40, 0.9), rgba(30, 30, 40, 0.9)) padding-box,
        var(--gradient-color) border-box;
    box-shadow: 
        0 25px 50px rgba(0,0,0,0.4),
        0 10px 30px rgba(252, 0, 168, 0.2);
}

.modal-overlay.is-visible .modal-content {
    transform: translateY(0) scale(1);
}

/* 3. Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

body.dark-theme .modal-header {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.modal-header h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    /* Gradient Text */
    background: var(--gradient-color);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 4. Close Button */
.modal-close {
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-color-light);
    cursor: pointer;
    transition: all 0.3s;
    width: 40px; 
    height: 40px;
    border-radius: 50%;
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.modal-close:hover {
    color: var(--first-color);
    background: rgba(252, 0, 168, 0.1);
    transform: rotate(90deg);
}

/* 5. Toolbar & Search Input */
.modal-toolbar {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.modal-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.modal-search-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--first-color);
    font-size: 1.1rem;
}

#modalSearchInput {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem;
    border-radius: 50px; /* Pill Shape */
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(5px);
    font-size: 0.95rem;
    transition: all 0.3s;
    color: var(--text-color);
}

body.dark-theme #modalSearchInput {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
}

#modalSearchInput:focus {
    outline: none;
    border-color: var(--first-color);
    box-shadow: 0 0 0 4px rgba(252, 0, 168, 0.1);
    background: white;
}

body.dark-theme #modalSearchInput:focus {
    background: rgba(30,30,40,1);
}

/* 6. List Content */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem; /* Space for scrollbar */
}

/* Scrollbar Styling */
.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.1);
    border-radius: 10px;
}
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

/* Convenio Items */
.convenio-item-modal {
    display: flex;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.8rem;
    background: rgba(255,255,255,0.4);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 16px;
    transition: all 0.3s;
}

body.dark-theme .convenio-item-modal {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

.convenio-item-modal:hover {
    background: var(--container-color);
    transform: translateX(5px);
    border-color: var(--first-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.convenio-item-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 10px;
    margin-right: 1rem;
    background: white;
    padding: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.convenio-item-name {
    font-weight: 500;
    color: var(--title-color);
    font-size: 1rem;
}

/* 7. Juridico Specifics */
.juridico-info-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-info__item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255,255,255,0.5);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.3);
}

body.dark-theme .contact-info__item {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.05);
}

.contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(252, 0, 168, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--first-color);
    font-size: 1.5rem;
    margin-right: 1rem;
}

.contact-info__text strong {
    display: block;
    color: var(--title-color);
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.contact-info__text a, .contact-info__text span {
    color: var(--text-color);
    font-weight: 500;
}

/* ======================================================== */
/* ==   RESPONSIVE                                       == */
/* ======================================================== */
@media screen and (max-width: 768px) {
    .premium-category-card {
        padding: 2rem;
    }
    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }
    .modal-header h2 {
        font-size: 1.4rem;
    }
    .modal-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .modal-search-wrapper {
        width: 100%;
    }
}