/* ==========================================
   BRACHLINE - CSS PRINCIPAL
   Diseño minimalista blanco y negro responsive
   ========================================== */

:root {
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --color-bg: #ffffff;
    --color-text: #000000;
    --color-text-secondary: #666666;
    --color-border: #e5e7eb;
    --color-gray-light: #f9fafb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --max-width: 1350px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
}

/* ==========================================
   FONDO LÍQUIDO ANIMADO
   ========================================== */
.fluid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 50%, #fafafa 100%);
}

.fluid-bg::before,
.fluid-bg::after {
    content: '';
    position: absolute;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.04) 50%, transparent 100%);
    filter: blur(60px);
}

.fluid-bg::before {
    width: 700px;
    height: 700px;
    top: -250px;
    right: -150px;
    animation: liquidMove1 45s ease-in-out infinite;
}

.fluid-bg::after {
    width: 600px;
    height: 600px;
    bottom: -200px;
    left: -150px;
    animation: liquidMove2 50s ease-in-out infinite;
    animation-delay: 5s;
}

@keyframes liquidMove1 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
        border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    }

    25% {
        transform: translate(-120px, 80px) rotate(90deg);
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }

    50% {
        transform: translate(-80px, 150px) rotate(180deg);
        border-radius: 30% 70% 50% 50% / 50% 60% 40% 60%;
    }

    75% {
        transform: translate(80px, 80px) rotate(270deg);
        border-radius: 70% 30% 60% 40% / 30% 50% 50% 70%;
    }
}

@keyframes liquidMove2 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
        border-radius: 30% 70% 50% 50% / 50% 60% 40% 60%;
    }

    33% {
        transform: translate(100px, -80px) rotate(120deg);
        border-radius: 50% 50% 70% 30% / 40% 60% 30% 70%;
    }

    66% {
        transform: translate(-80px, -60px) rotate(240deg);
        border-radius: 70% 30% 40% 60% / 60% 40% 60% 40%;
    }
}

/* ==========================================
   ANIMACIONES DE SCROLL
   ========================================== */
.fade-in-up,
.fade-in-left,
.fade-in-right,
.scale-in {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-up {
    transform: translateY(40px);
}

.fade-in-left {
    transform: translateX(-40px);
}

.fade-in-right {
    transform: translateX(40px);
}

.scale-in {
    transform: scale(0.92);
}

.fade-in-up.visible,
.fade-in-left.visible,
.fade-in-right.visible,
.scale-in.visible {
    opacity: 1;
    transform: translate(0) scale(1);
}

.fade-in-up:nth-child(1) {
    transition-delay: 0.1s;
}

.fade-in-up:nth-child(2) {
    transition-delay: 0.2s;
}

.fade-in-up:nth-child(3) {
    transition-delay: 0.3s;
}

.fade-in-up:nth-child(4) {
    transition-delay: 0.4s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   CONTENEDOR PRINCIPAL
   ========================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* ==========================================
   NAVBAR
   ========================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 1500px;
    z-index: 1000;
    padding: 0.75rem 0;

    margin: 1rem auto;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #000000;
    letter-spacing: -0.5px;
    text-decoration: none;
    display: flex;
    align-items: center;
    flex: 1;
}

.logo img {
    height: 60px;
    width: auto;
    transition: all 0.3s ease;
    filter: brightness(0) invert(1);
}

.navbar.scrolled .logo img {
    height: 40px;
    filter: none;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    flex: 1;
    justify-content: center;
}

.nav-item {
    position: relative;
    cursor: pointer;
    font-weight: 500;
    padding: 0.5rem 0;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.navbar.scrolled .nav-item {
    color: #000000;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #ffffff;
    transition: width 0.3s ease;
}

.navbar.scrolled .nav-item::after {
    background: #000000;
}

.nav-item:hover {
    color: #cccccc;
}

.navbar.scrolled .nav-item:hover {
    color: #666666;
}

.mega-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
}

.mega-item:hover {
    background: var(--color-gray-light);
    border-color: var(--color-border);
}

.mega-icon {
    width: 40px;
    height: 40px;
    background: #000000;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 1.2rem;
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: flex-end;
}

/* Ocultar texto del botón de login en escritorio, dejando solo el ícono */
.auth-buttons .btn-login {
    font-size: 0;
}

.auth-buttons .btn-login i,
.auth-buttons .btn-login img {
    font-size: 18px;
}

/* ==========================================
   BOTONES
   ========================================== */
.btn {
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #000000;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
    font-family: var(--font-main);
    text-align: center;
}

.btn-primary {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.btn-primary:hover {
    background: #ffffff;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: #ffffff;
    color: #000000;
}

.btn-secondary:hover {
    background: var(--color-gray-light);
    transform: translateY(-2px);
}

/* ==========================================
   SECCIONES Y HERO
   ========================================== */
section {
    padding: 5rem 0;
}

.hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    text-align: center;
    background-color: #000000;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #ffffff;
    letter-spacing: -2px;
    line-height: 1.1;
    animation: fadeInUp 0.8s ease;
}

.hero p {
    font-size: 1.25rem;
    color: #cccccc;
    max-width: 650px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
    animation: fadeInUp 0.8s ease 0.2s backwards;
}

/* ==========================================
   TARJETAS
   ========================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 2.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #000000;
    transform: scaleX(0);
    transition: transform 0.3s ease;
    border-radius: 1rem 1rem 0 0;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #000000;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #000000;
    font-weight: 700;
}

.card p {
    color: var(--color-text-secondary);
    line-height: 1.6;
}

/* ==========================================
   DASHBOARD
   ========================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    min-height: 80vh;
    margin-top: 2rem;
}

.sidebar {
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 1.5rem;
}

.sidebar-item {
    padding: 0.875rem 1rem;
    display: block;
    color: var(--color-text);
    text-decoration: none;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar-item:hover {
    background: var(--color-gray-light);
}

.sidebar-item.active {
    background: #000000;
    color: white;
}

/* ==========================================
   ENCABEZADOS DE SECCIÓN
   ========================================== */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #000000;
    letter-spacing: -1px;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================
   FOOTER
   ========================================== */
footer {
    background: #000000;
    color: white;
    padding: 4rem 0 2rem;
    margin-top: 0;
}

footer h3,
footer h4 {
    color: white;
    margin-bottom: 1rem;
}

footer a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

footer a:hover {
    color: white;
}

footer ul {
    list-style: none;
    padding: 0;
}

footer li {
    margin-bottom: 0.5rem;
}

/* ==========================================
   UTILIDADES
   ========================================== */
::selection {
    background: #000000;
    color: white;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 1024px) {
    .hero h1 {
        font-size: 3rem;
    }

    .dashboard-grid {
        grid-template-columns: 220px 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        gap: 1.5rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        margin-bottom: 2rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .logo img {
        height: 40px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* SweetAlert2 Custom Styles */
.swal-custom-popup {
    position: relative;
    border-radius: 16px !important;
    padding: clamp(1.75rem, 3vw, 2.75rem) !important;
    font-family: 'Outfit', sans-serif !important;
    background: #ffffff !important;
    border: 1px solid rgba(17, 24, 39, 0.08) !important;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.15) !important;
    animation: popupFloat 0.25s ease-out;
    box-sizing: border-box !important;
    max-width: 760px !important;
    width: min(760px, 96vw) !important;
    color: #0f172a !important;
}

.swal2-title {
    font-size: clamp(1.35rem, 2vw, 1.65rem) !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.025em;
    margin-bottom: 1.25rem !important;
}

.swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    max-height: calc(80vh - 11rem);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-align: left !important;
    color: #111827;
}

.swal2-html-container::-webkit-scrollbar {
    width: 6px;
}

.swal2-html-container::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.2);
    border-radius: 999px;
}

.swal2-html-container label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #111827;
    margin-bottom: 0.45rem;
    white-space: nowrap;
}

.swal2-html-container small {
    font-size: 0.8rem;
    color: #4b5563;
}

.swal2-html-container input,
.swal2-html-container select,
.swal2-html-container textarea {
    width: 100%;
    border: 1px solid #d1d5db !important;
    border-radius: 12px !important;
    padding: 0.85rem 1.1rem !important;
    font-size: 0.95rem !important;
    font-weight: 500;
    background: #ffffff !important;
    color: #111827 !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

.swal2-html-container input:focus,
.swal2-html-container select:focus,
.swal2-html-container textarea:focus {
    border-color: #0f172a !important;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.15) !important;
    outline: none;
}

.swal2-html-container input::placeholder,
.swal2-html-container textarea::placeholder {
    color: #94a3b8;
}

.swal2-actions {
    margin-top: 2rem !important;
    gap: 1rem !important;
    width: 100%;
    display: flex !important;
    flex-wrap: wrap;
    z-index: 200000 !important;
}

.swal2-actions .btn {
    flex: 1;
    min-width: 120px;
    z-index: 200001 !important;
    position: relative !important;
}

.swal2-confirm.btn-primary {
    background: linear-gradient(135deg, #000000, #111827) !important;
    color: #ffffff !important;
    padding: 0.85rem 1.75rem !important;
    border-radius: 999px !important;
    font-weight: 600 !important;
    border: none !important;
    box-shadow: 0 15px 25px -10px rgba(0, 0, 0, 0.4) !important;
}

.swal2-confirm.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 35px -12px rgba(0, 0, 0, 0.45) !important;
}

.swal2-cancel.btn-secondary {
    background: transparent !important;
    color: #111827 !important;
    padding: 0.85rem 1.75rem !important;
    border-radius: 999px !important;
    font-weight: 600 !important;
    border: 1px solid rgba(17, 24, 39, 0.15) !important;
}

.swal2-cancel.btn-secondary:hover {
    background: rgba(15, 23, 42, 0.05) !important;
}

.swal2-file {
    font-size: 0.9rem !important;
}

.swal2-popup .file-drop,
.swal2-popup label[data-file-drop="true"] {
    border: 1.5px dashed rgba(15, 23, 42, 0.15);
    border-radius: 18px;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.02);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.swal2-popup .file-drop:hover,
.swal2-popup label[data-file-drop="true"]:hover {
    border-color: rgba(15, 23, 42, 0.3);
    background: rgba(15, 23, 42, 0.04);
}

@keyframes popupFloat {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================
   MEGA MENU
   ========================================== */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 700px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
}

.nav-item:hover .mega-menu {
    display: grid;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mega-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
}

.mega-item:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.mega-icon {
    width: 40px;
    height: 40px;
    background: #000000;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 1.2rem;
}

/* SweetAlert2 Input Icons Fix */
.swal2-html-container i[class*="hgi-"] {
    pointer-events: none;
    z-index: 10;
}

/* Ensure icons are visible */
.swal2-html-container .hgi-stroke {
    font-size: 18px;
}

.swal2-html-container i + .swal2-input,
.swal2-html-container i + .swal2-textarea,
.swal2-html-container i + .swal2-select {
    padding-left: 3.1rem !important;
}

/* SweetAlert2 Form Helpers */
.swal2-html-container .swal-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.swal2-html-container .swal-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.swal2-html-container .swal-form-label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111827;
}

.swal2-html-container .swal-field-wrapper {
    position: relative;
}

.swal2-html-container .swal-field-wrapper i[class*="hgi-"] {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #9ca3af;
}

.swal2-html-container .swal-field-wrapper.has-icon .swal2-select,
.swal2-html-container .swal-field-wrapper.has-icon .swal2-input,
.swal2-html-container .swal-field-wrapper.has-icon .swal2-textarea {
    padding-left: 3.1rem !important;
}

/* SweetAlert2 Z-Index Fix - Ensure popups are always on top */
.swal2-container {
    z-index: 99999 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    pointer-events: none !important;
}

.swal2-popup {
    z-index: 100000 !important;
    pointer-events: auto !important;
    position: relative !important;
}

/* Ensure backdrop is visible but doesn't block clicks */
.swal2-container.swal2-backdrop-show {
    background: rgba(0, 0, 0, 0.5) !important;
    pointer-events: none !important;
}

/* SweetAlert2 Close Button Styles */
.swal2-close {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 36px !important;
    height: 36px !important;
    font-size: 28px !important;
    color: #6b7280 !important;
    background: rgba(107, 114, 128, 0.1) !important;
    border-radius: 8px !important;
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    z-index: 2147483647 !important;
    pointer-events: auto !important;
}

.swal2-close:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
    transform: scale(1.05);
}

.swal2-close:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3) !important;
}

/* Fix for buttons not responding */
.swal2-actions button {
pointer-events: auto !important;
cursor: pointer !important;
}

.swal2-confirm,
.swal2-cancel,
.swal2-deny {
pointer-events: auto !important;
cursor: pointer !important;
position: relative !important;
z-index: 1 !important;
}

/* ==========================================
MEDIA QUERIES - RESOLUCIONES INTERMEDIAS
========================================== */

/* El menú hamburguesa ahora se activa en max-width: 1200px */
/* Ver mobile-menu.css y mobile-responsive.css para estilos móviles */