/* ============================================================
   DISEÑOS EL TIBURÓNSIN - Custom Styles
   Cyberpunk / Neon Aesthetic
   ============================================================ */

/* ---- GLOBAL RESET & BASE ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    overflow-x: hidden;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0a0a0f;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #22d3ee, #f43f5e);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #06b6d4, #e11d48);
}

/* Selection */
::selection {
    background: #22d3ee30;
    color: #22d3ee;
}

/* ---- NAVIGATION ---- */
#navbar {
    background: transparent;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

#navbar.scrolled {
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(34, 211, 238, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* Nav link styles - Tech feel */
.nav-link {
    letter-spacing: 0.15em;
    font-weight: 600;
    text-transform: uppercase;
}

/* Nav link underline effect */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #22d3ee, #f43f5e);
    transition: width 0.3s ease;
    border-radius: 2px;
    box-shadow: 0 0 8px #22d3ee;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Mobile menu animation */
#mobile-menu.open {
    transform: translateX(0);
}

/* Hamburger animation */
.menu-open #menu-line-1 {
    transform: rotate(45deg) translateY(4px);
}
.menu-open #menu-line-2 {
    opacity: 0;
}
.menu-open #menu-line-3 {
    transform: rotate(-45deg) translateY(-4px);
}

/* ---- HERO SECTION ---- */
#hero-title {
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.3);
}

/* Slogan container */
#slogan-container {
    mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
}

/* ---- SERVICE CARDS ---- */
.service-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.03), transparent);
    transition: left 0.6s ease;
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    transform: translateY(-8px);
}

/* ---- REEL CARDS ---- */
.reel-card {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 1rem;
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.15), 0 0 30px rgba(34, 211, 238, 0.05);
}

.reel-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 25px rgba(34, 211, 238, 0.3), 0 0 50px rgba(34, 211, 238, 0.1);
}

.reel-card video {
    filter: brightness(0.95) contrast(1.05);
    aspect-ratio: 9 / 16;
    object-fit: cover;
}

.reel-card:hover video {
    filter: brightness(1) contrast(1.1);
}

/* ---- GALLERY ---- */
.gallery-item {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(34, 211, 238, 0.2);
    box-shadow: 0 0 15px rgba(34, 211, 238, 0.1), 0 0 30px rgba(34, 211, 238, 0.05), inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover {
    transform: translateY(-6px);
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 0 25px rgba(34, 211, 238, 0.25), 0 0 50px rgba(34, 211, 238, 0.1), inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover img {
    filter: brightness(1.15);
}

/* "VER PROYECTO" overlay */
.gallery-item .gallery-hover-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 30;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.gallery-item:hover .gallery-hover-label {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ---- LIGHTBOX ---- */
#lightbox.active {
    opacity: 1;
    pointer-events: all;
}

#lightbox.active #lightbox-img {
    transform: scale(1);
}

/* ---- FORM STYLES ---- */
.form-group {
    position: relative;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #22d3ee;
    box-shadow: 0 4px 15px -5px rgba(34, 211, 238, 0.3);
}

/* Select dropdown styling */
.form-group select option {
    background: #111118;
    color: white;
    padding: 10px;
}

/* Form success/error states */
#form-status.success {
    display: block;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    color: #22d3ee;
}

#form-status.error {
    display: block;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.3);
    color: #f43f5e;
}

/* ---- SCROLL REVEAL ---- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    will-change: opacity, transform;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children */
.scroll-reveal:nth-child(2) {
    transition-delay: 0.1s;
}
.scroll-reveal:nth-child(3) {
    transition-delay: 0.2s;
}

/* ---- FLOATING WHATSAPP PULSE ---- */
#whatsapp-float {
    background: linear-gradient(135deg, #22d3ee, #06b6d4) !important;
    background-color: #22d3ee !important;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.6), 0 0 40px rgba(34, 211, 238, 0.25) !important;
    border: 2px solid rgba(34, 211, 238, 0.4);
}

#whatsapp-float:hover {
    box-shadow: 0 0 35px rgba(34, 211, 238, 0.8), 0 0 70px rgba(34, 211, 238, 0.35) !important;
    border-color: rgba(34, 211, 238, 0.7);
}

#whatsapp-float::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(34, 211, 238, 0.3);
    animation: whatsappPulse 2s ease-in-out infinite;
    z-index: -1;
}

#whatsapp-float::after {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: rgba(34, 211, 238, 0.15);
    animation: whatsappPulse 2s ease-in-out infinite 0.5s;
    z-index: -1;
}

@keyframes whatsappPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.4);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* ---- FOOTER ---- */
footer a {
    position: relative;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #22d3ee;
    transition: width 0.3s ease;
}

footer a:hover::after {
    width: 100%;
}

/* ---- PARTICLES / DIGITAL NOISE ---- */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ---- RESPONSIVE ADJUSTMENTS ---- */

/* Prevent ANY overflow globally */
section, header, footer, nav, div, main {
    max-width: 100vw;
}

img, video {
    max-width: 100%;
    height: auto;
}

/* ---- Tablet (768px and below) ---- */
@media (max-width: 768px) {
    /* Hero */
    #hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
        padding: 0 0.5rem;
        word-break: break-word;
    }

    #hero-logo {
        width: 8rem;
        height: 8rem;
    }

    /* Reels - Stack vertically */
    #reels .flex {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .reel-card {
        width: 100%;
        max-width: 280px;
    }

    .reel-card video {
        width: 100%;
        max-width: 280px;
        height: 420px;
        object-fit: cover;
    }

    /* Gallery - single column on tablet */
    #gallery-grid {
        grid-template-columns: 1fr !important;
    }

    #gallery-grid > div {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    .gallery-item img {
        min-height: 250px !important;
        max-height: 350px;
        width: 100%;
    }

    /* Form */
    #contact-form {
        padding: 1.5rem !important;
    }

    /* Footer */
    footer .grid {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    footer .grid > div {
        align-items: center !important;
    }

    /* Services grid */
    #servicios .grid {
        grid-template-columns: 1fr !important;
    }

    /* Section padding */
    section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ---- Mobile Large (640px and below) ---- */
@media (max-width: 640px) {
    #hero-title {
        font-size: 2.2rem;
    }

    .reel-card,
    .reel-card video {
        max-width: 260px;
    }

    .reel-card video {
        height: 390px;
    }

    /* Nav */
    #navbar nav {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* ---- Mobile Small (480px and below) ---- */
@media (max-width: 480px) {
    #hero-title {
        font-size: 1.8rem;
        letter-spacing: 0.05em;
    }

    #hero-logo {
        width: 6rem;
        height: 6rem;
    }

    .reel-card,
    .reel-card video {
        max-width: 240px;
    }

    .reel-card video {
        height: 360px;
    }

    /* Slogan text */
    .slogan-text {
        font-size: 0.95rem !important;
        padding: 0 0.5rem;
    }

    /* Service cards */
    .service-card {
        padding: 1.5rem !important;
    }

    /* CTA button */
    #hero-cta-btn {
        padding: 0.75rem 2rem;
        font-size: 0.75rem;
    }

    /* Section titles */
    section h2 {
        font-size: 1.6rem !important;
    }

    /* Footer contact info */
    footer span {
        font-size: 0.85rem;
    }

    /* Lightbox */
    #lightbox-img {
        max-height: 70vh;
    }
}

/* ---- Extra Small (360px and below) ---- */
@media (max-width: 360px) {
    #hero-title {
        font-size: 1.5rem;
    }

    .reel-card,
    .reel-card video {
        max-width: 220px;
    }

    .reel-card video {
        height: 330px;
    }

    #hero-cta-btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.7rem;
    }

    section h2 {
        font-size: 1.3rem !important;
    }
}

/* ---- GRADIENT TEXT UTILITY ---- */
.text-gradient-cyan {
    background: linear-gradient(135deg, #22d3ee, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-pink {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---- LOADING ANIMATION FOR SUBMIT BUTTON ---- */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---- GLITCH TITLE EFFECT ---- */
.glitch-title {
    color: transparent;
    -webkit-text-stroke: 2px #22d3ee;
    text-shadow: 
        0 0 20px rgba(34, 211, 238, 0.5),
        0 0 40px rgba(34, 211, 238, 0.2),
        3px 3px 0 rgba(244, 63, 94, 0.3),
        -2px -2px 0 rgba(34, 211, 238, 0.3);
    position: relative;
}

.glitch-title::before,
.glitch-title::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-text-stroke: 2px #22d3ee;
}

.glitch-title::before {
    color: transparent;
    -webkit-text-stroke: 2px #f43f5e;
    text-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
    animation: glitch-1 3s infinite linear alternate-reverse;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.glitch-title::after {
    color: transparent;
    -webkit-text-stroke: 2px #22d3ee;
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.4);
    animation: glitch-2 2.5s infinite linear alternate-reverse;
    clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-1 {
    0%, 85% { transform: translate(0); }
    86% { transform: translate(-3px, -1px); }
    87% { transform: translate(3px, 1px); }
    88% { transform: translate(-2px, 0); }
    89%, 100% { transform: translate(0); }
}

@keyframes glitch-2 {
    0%, 90% { transform: translate(0); }
    91% { transform: translate(2px, 1px); }
    92% { transform: translate(-3px, -1px); }
    93% { transform: translate(1px, 0); }
    94%, 100% { transform: translate(0); }
}

/* ---- SCANNER CORNER BORDERS (HUD / Iron Man style) ---- */
.scanner-form {
    padding: 12px;
}

.scanner-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    z-index: 20;
    pointer-events: none;
}

.scanner-corner-tl {
    top: 0;
    left: 0;
    border-top: 2px solid #22d3ee;
    border-left: 2px solid #22d3ee;
    box-shadow: -2px -2px 8px rgba(34, 211, 238, 0.3);
}

.scanner-corner-tr {
    top: 0;
    right: 0;
    border-top: 2px solid #22d3ee;
    border-right: 2px solid #22d3ee;
    box-shadow: 2px -2px 8px rgba(34, 211, 238, 0.3);
}

.scanner-corner-bl {
    bottom: 0;
    left: 0;
    border-bottom: 2px solid #f43f5e;
    border-left: 2px solid #f43f5e;
    box-shadow: -2px 2px 8px rgba(244, 63, 94, 0.3);
}

.scanner-corner-br {
    bottom: 0;
    right: 0;
    border-bottom: 2px solid #f43f5e;
    border-right: 2px solid #f43f5e;
    box-shadow: 2px 2px 8px rgba(244, 63, 94, 0.3);
}

/* Scanner corner glow animation */
.scanner-corner {
    animation: scannerGlow 3s ease-in-out infinite alternate;
}

@keyframes scannerGlow {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* ---- CONTACT FORM RESPONSIVE ---- */
@media (max-width: 768px) {
    .glitch-title {
        font-size: 2.5rem !important;
        -webkit-text-stroke: 1.5px #22d3ee;
    }
    
    .scanner-corner {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .glitch-title {
        font-size: 2rem !important;
        -webkit-text-stroke: 1px #22d3ee;
    }
}
