@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;700;800&display=swap');

:root {
    --bg-dark: #070B14;
    --bg-page: #0B1121;
    --card-bg: rgba(15, 23, 42, 0.5);
    --card-bg-hover: rgba(15, 23, 42, 0.8);
    --card-border: rgba(255, 255, 255, 0.08);
    --gold-primary: #F59E0B;
    --gold-secondary: #D97706;
    --gold-glow: rgba(245, 158, 11, 0.25);
    --cyan-primary: #06B6D4;
    --cyan-glow: rgba(6, 182, 212, 0.25);
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --accent-blue: #3B82F6;
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #EF4444;
    --glass-blur: blur(20px);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(245, 158, 11, 0.04), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(6, 182, 212, 0.04), transparent 25%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* Header & Navigation */
header {
    background: rgba(7, 11, 20, 0.7);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    background: transparent !important;
    padding: 0.5rem 0;
}

.navbar-toggler-icon {
    filter: invert(1);
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.6rem 1.2rem !important;
    transition: var(--transition-smooth);
    border-radius: 8px;
    margin: 0 0.25rem;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 2px;
    background: var(--gold-primary);
    transition: var(--transition-smooth);
    transform: translateX(-50%);
    opacity: 0;
}

.nav-link:hover {
    color: var(--text-primary) !important;
    background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
    color: var(--gold-primary) !important;
    background: rgba(245, 158, 11, 0.08);
}

.nav-link.active::before {
    width: 100%;
    opacity: 1;
}

#logo {
    max-height: 48px;
    transition: var(--transition-smooth);
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.3));
}
#logo:hover {
    transform: scale(1.05) rotate(2deg);
    filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.6));
}

.text-primary, .h4.text-primary {
    color: var(--gold-primary) !important;
}

/* Utility / Container */
.container {
    max-width: 1200px;
}

/* Cards (Glassmorphism) */
.calculation-section, .pipe-section {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.calculation-section::before, .pipe-section::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.02), transparent);
    transform: skewX(-20deg);
    transition: var(--transition-smooth);
}

.calculation-section:hover, .pipe-section:hover {
    transform: translateY(-5px);
    background: var(--card-bg-hover);
    border-color: rgba(245, 158, 11, 0.2);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(245, 158, 11, 0.05);
}

.calculation-section:hover::before, .pipe-section:hover::before {
    left: 200%;
    transition: 0.8s ease-in-out;
}

.calculation-section h3 {
    color: var(--text-primary);
    font-size: 1.6rem;
    margin-bottom: 1.8rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Icon Wrappers to make icons pop */
.icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--gold-primary);
    border-radius: 12px;
    font-size: 1.4rem;
    box-shadow: 0 0 15px var(--gold-glow);
}

.icon-wrapper.cyan {
    background: rgba(6, 182, 212, 0.1);
    color: var(--cyan-primary);
    box-shadow: 0 0 15px var(--cyan-glow);
}

.icon-wrapper.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

/* Forms & Inputs */
.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.form-control, .form-select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    transition: var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    background: rgba(15, 23, 42, 0.9);
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
    color: #fff;
    outline: none;
}

.form-control::placeholder {
    color: rgba(148, 163, 184, 0.4);
}

.input-group-text {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 0.8rem 1.6rem;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: var(--transition-smooth);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
    border: none;
    color: #070B14;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #fbbf24, var(--gold-primary));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--gold-glow);
    color: #070B14;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.3);
}

/* Alerts and Info Boxes */
.alert-custom {
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    color: #a5f3fc;
    backdrop-filter: var(--glass-blur);
    border-radius: 16px;
}
.alert-custom strong {
    color: #fff;
}

.formula-box {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--cyan-primary);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 12px 12px 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.formula-box::after {
    content:'';
    position: absolute;
    top:0; left:0; width: 100%; height:100%;
    background: linear-gradient(90deg, var(--cyan-glow), transparent);
    opacity: 0.1;
    pointer-events: none;
}

.formula-box h5 {
    color: var(--cyan-primary);
    font-size: 1.05rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Result Boxes */
.result-box {
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 2rem;
    margin: 2rem 0;
    border-radius: 16px;
    animation: fadeInUp 0.5s ease-out forwards;
    position: relative;
    overflow: hidden;
}

.result-box::before {
    content: '';
    position: absolute;
    top:-50%; left:-50%; width:200%; height:200%;
    background: radial-gradient(circle, rgba(16,185,129,0.1) 0%, transparent 60%);
    pointer-events: none;
    animation: pulseGlow 4s infinite alternate;
}

.result-box.border-gold-glow {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
}
.result-box.border-gold-glow::before {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 60%);
}

.result-box h5 {
    color: var(--success);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.result-value {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--gold-primary);
    margin: 0 0.25rem;
    text-shadow: 0 0 15px var(--gold-glow);
    position: relative;
    z-index: 1;
}

.unit {
    color: #94A3B8;
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

/* Select Multiple (Secciones) */
.seccion-tuberia-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    margin-bottom: 1rem;
    animation: slideInRight 0.3s ease-out forwards;
}

/* Animations Section Overlay */
.animation-section {
    background: #ffffff;
    border-radius: 20px;
    max-width: 800px;
    margin: 0 auto 3rem auto;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--card-border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.animation-section iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}

.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition-smooth);
    animation: bounce 2s infinite;
    background: rgba(15, 23, 42, 0.7);
    padding: 10px 20px;
    border-radius: 50px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    backdrop-filter: var(--glass-blur);
}

.scroll-indicator:hover {
    background: rgba(15, 23, 42, 0.9);
    border-color: var(--gold-primary);
    box-shadow: 0 0 15px var(--gold-glow);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}

.background-equipo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    transition: var(--transition-smooth);
    filter: brightness(0.7) contrast(1.1);
}

.animation-section:hover .background-equipo {
    opacity: 0.5;
    transform: scale(1.02);
}

/* Gradiente fluido adicional sobre animación */
.fluid-path {
    z-index: 2;
    opacity: 0.8;
}

/* Social Sidebar */
.social-sidebar {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.2rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.social-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.4rem;
    transition: var(--transition-smooth);
    text-decoration: none;
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
}

.social-icon:hover {
    transform: scale(1.15) translateY(-3px);
    color: var(--gold-primary);
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.2);
    box-shadow: 0 10px 20px var(--gold-glow);
}

/* Tables */
.table {
    color: var(--text-primary);
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
}

.table-glass {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
}

.table-glass thead th {
    background: rgba(255,255,255,0.03);
    color: var(--gold-primary);
    border: none;
    border-bottom: 1px solid var(--card-border);
    padding: 1.25rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.table-glass tbody td {
    border-color: var(--card-border);
    padding: 1rem 1.25rem;
    vertical-align: middle;
    background: transparent;
    color: var(--text-primary);
}

.table-hover tbody tr {
    transition: var(--transition-fast);
}

.table-hover tbody tr:hover td {
    background: rgba(245, 158, 11, 0.05);
    color: #fff;
}

/* Footer */
footer {
    background: rgba(7, 11, 20, 0.8);
    border-top: 1px solid var(--card-border);
    padding: 4rem 0 2rem;
    margin-top: 4rem;
    position: relative;
}

.footer-link {
    color: var(--gold-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.footer-link:hover {
    color: #fcd34d;
    text-shadow: 0 0 10px var(--gold-glow);
}

/* Utilities & Animations */
.form-check-input {
    background-color: rgba(255,255,255,0.1);
    border-color: var(--card-border);
}
.form-check-input:checked {
    background-color: var(--gold-primary);
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px var(--gold-glow);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.05); opacity: 0.8; }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* Text Colors specific overrides */
.text-gold-primary { color: var(--gold-primary) !important; }
.text-gold-primary-glow {
    color: var(--gold-primary) !important;
    text-shadow: 0 0 15px var(--gold-glow);
}
.text-cyan { color: var(--cyan-primary) !important; }

/* Responsive Adjustments */
@media (max-width: 991px) {
    .social-sidebar {
        flex-direction: row;
        bottom: 20px;
        top: auto;
        left: 50%;
        transform: translateX(-50%);
        width: max-content;
        gap: 0.8rem;
        padding: 0.8rem 1.2rem;
    }
    .social-icon {
        width: 40px; height: 40px;
        font-size: 1.2rem;
    }
    .calculation-section, .pipe-section {
        padding: 1.5rem;
    }
    .animation-section {
        height: auto;
    }
    .navbar-toggler-icon {
        filter: invert(1);
    }
}