/* 
   IFANJOY - MODERN DESIGN SYSTEM 2.0
   Premium Dark Mode / Glassmorphism / Vibrant Accents
*/

:root {
    /* Core Colors */
    --primary: #00f2ff;
    --primary-alt: #0066ff;
    --secondary: #7000ff;
    --accent: #ff00c8;

    /* Neutral / Dark Palette */
    --bg-dark: #030712;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-glass: rgba(255, 255, 255, 0.1);

    /* Text */
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    /* Gradients */
    --grad-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-alt) 100%);
    --grad-surface: linear-gradient(135deg, #111827 0%, #030712 100%);
    --grad-accent: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);

    /* Effects */
    /* Layout */
    --container-width: 1400px;
    /* Wider for premium desktop feel */
    --header-height: 110px;

    /* Effects */
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    --transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* --- Base & Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Typography --- */
h1,
h2,
h3,
h4 {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.5rem;
}

.text-gradient {
    background: var(--grad-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* --- Layout --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    /* Standard mobile padding */
    width: 100%;
}

@media (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
}

section {
    padding: 5rem 0;
    /* Mobile spacing */
}

@media (min-width: 1024px) {
    section {
        padding: 8rem 0;
        /* Desktop spacing */
    }
}

/* --- Components --- */

/* Glass Card */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 2rem;
    /* Mobile padding */
    transition: var(--transition);
}

@media (min-width: 768px) {
    .glass-card {
        padding: 2.5rem;
    }
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: 100px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    gap: 0.75rem;
    min-height: 48px;
    /* Touch target size */
    font-size: 1rem;
}

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}

.btn-primary:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.5);
}

.btn-secondary {
    background: var(--bg-glass);
    color: #fff;
    border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: var(--header-height);
    overflow: hidden;
}

.hero-bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0, 242, 255, 0.1) 0%, transparent 70%);
    z-index: -1;
    filter: blur(60px);
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    margin-bottom: 2rem;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--text-muted);
    max-width: 800px;
    margin: 0 auto 3rem;
    line-height: 1.4;
}

/* --- Services Grid --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
    background: var(--bg-glass);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

/* --- AI Phone Section --- */
.ai-section {
    background: linear-gradient(180deg, var(--bg-dark) 0%, #0a0a0a 100%);
    position: relative;
}

.ai-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.ai-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(112, 0, 255, 0.1) 0%, transparent 70%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-sphere {
    width: 300px;
    height: 300px;
    background: var(--grad-accent);
    border-radius: 50%;
    filter: blur(40px);
    animation: orbFloat 10s ease-in-out infinite alternate;
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(20px, -20px) scale(1.1);
    }
}

/* --- Responsive --- */
@media (max-width: 968px) {
    .ai-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    section {
        padding: 5rem 0;
    }
}

/* --- Animations --- */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: 1s ease-out;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Logo Fix --- */
.logo-container {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 120px;
    width: auto;
    object-fit: contain;
}

/* --- Contact Form Fixes --- */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.service-selection {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin-bottom: 1rem;
}

.service-option {
    position: relative;
}

.service-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.service-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    height: 100%;
}

.service-option input:checked+label {
    background: rgba(0, 242, 255, 0.1);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.15);
}

.service-option label:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ROI Calculator Styles */
.roi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.count-up {
    font-variant-numeric: tabular-nums;
}

/* Enhancements for Inputs */
select:focus,
input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.2);
}

/* Anti-Hater Shield Styles */
.response-card {
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.response-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.response-card:active {
    transform: scale(0.98);
}

#hater-input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 15px rgba(112, 0, 255, 0.2);
    outline: none;
}

/* Mobile Input Zoom Fix */
input,
select,
textarea {
    font-size: 16px !important;
    /* Prevents auto-zoom on iOS */
}

/* Fix for Select Dropdown visibility in Dark Mode */
select option {
    background-color: var(--bg-dark);
    color: var(--text-main);
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
        /* Better fit for mobile */
    }

    .hide-mobile {
        display: none !important;
    }

    .logo-img {
        height: 60px !important;
        /* Smaller logo on mobile to leave space */
    }

    .header .btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.8rem !important;
    }
}

/* --- Radar Section Styles --- */
.radar-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
    border-radius: 50%;
    background: rgba(0, 242, 255, 0.05);
    border: 1px solid rgba(0, 242, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.radar-sweep {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent);
    transform-origin: left center;
    animation: radarSweep 4s linear infinite;
    box-shadow: 0 0 15px var(--primary);
}

.radar-circle {
    position: absolute;
    border: 1px solid rgba(0, 242, 255, 0.1);
    border-radius: 50%;
}

.radar-circle:nth-child(1) {
    width: 100%;
    height: 100%;
}

.radar-circle:nth-child(2) {
    width: 66%;
    height: 66%;
}

.radar-circle:nth-child(3) {
    width: 33%;
    height: 33%;
}

.radar-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
    animation: pulse 2s infinite;
}

@keyframes radarSweep {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.radar-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
    text-align: center;
}

.stat-item h3 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}


/* --- 404 Page Specific Styles --- */
.error-page-body {
    background-color: #030712;
    color: #fff;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-family: 'Outfit', sans-serif;
    margin: 0;
}

.error-container {
    text-align: center;
    position: relative;
    z-index: 10;
    max-width: 600px;
    padding: 2rem;
}

.glitch-text {
    font-size: 8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    position: relative;
    color: #ff3366;
    text-shadow: 2px 2px #00f2fe;
    animation: glitch 1s infinite;
}

@keyframes glitch {
    0% {
        transform: translate(0)
    }

    20% {
        transform: translate(-2px, 2px)
    }

    40% {
        transform: translate(-2px, -2px)
    }

    60% {
        transform: translate(2px, 2px)
    }

    80% {
        transform: translate(2px, -2px)
    }

    100% {
        transform: translate(0)
    }
}

.search-bar-404 {
    margin: 2rem 0;
    position: relative;
}

.search-input-404 {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-input-404:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(112, 0, 255, 0.3);
}

.popular-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.link-pill {
    padding: 0.5rem 1.2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    text-decoration: none;
    color: #ccc;
    font-size: 0.9rem;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.link-pill:hover {
    border-color: var(--secondary);
    color: #fff;
    background: rgba(0, 242, 255, 0.1);
}

.astronaut {
    width: 150px;
    animation: float 6s ease-in-out infinite;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 20px rgba(112, 0, 255, 0.5));
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

.background-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-image: radial-gradient(white 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.1;
    pointer-events: none;
}

/* --- Premium Case Study Styles --- */
.case-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-top: 4rem;
}

.case-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    padding: 3rem;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.case-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 242, 255, 0.1);
}

.case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, rgba(0, 242, 255, 0.05), transparent 70%);
    pointer-events: none;
}

.case-category {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: block;
}

.case-card h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.case-metric {
    font-size: 3rem;
    font-weight: 800;
    color: #fff;
    margin: 1.5rem 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.case-metric span {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.metric-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(0, 242, 255, 0.1);
    border-radius: 100px;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.case-results-list {
    list-style: none;
    padding: 0;
    margin-top: auto;
}

.case-results-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}

.case-results-list li svg {
    color: var(--primary);
}

/* Geo-Personalization Animation */
[data-geo-city] {
    transition: all 0.5s ease;
    position: relative;
    display: inline-block;
}

[data-geo-city].geo-active {
    color: var(--primary);
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.4);
    animation: cityPulse 2s ease-in-out infinite;
}

@keyframes cityPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.8;
    }
}

/* Specific Fix for cases not showing as grid */
section#exito .case-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 2.5rem !important;
}

@media (max-width: 768px) {
    section#exito .case-grid {
        grid-template-columns: 1fr !important;
    }

    .case-card {
        padding: 2rem !important;
    }

    .case-metric {
        font-size: 2.5rem !important;
    }
}