/* 
 * MediaZaragoza - Corporate Website Styles
 * Theme: Modern, Tech-Oriented, Minimalist, Premium
 * Primary Colors: Deep Navy, Vibrant Cyan/Purple Gradients
 */

:root {
    --primary-color: #0f172a;
    /* Slate 900 */
    --secondary-color: #1e293b;
    /* Slate 800 */
    --accent-color: #06b6d4;
    /* Cyan 500 */
    --accent-dark: #0891b2;
    /* Cyan 600 - WCAG Compliant for white bg */
    --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
    /* Cyan to Purple */
    --text-color: #f8fafc;
    /* Slate 50 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --white: #ffffff;
    --glass-bg: rgba(15, 23, 42, 0.8);
    --border-color: rgba(148, 163, 184, 0.1);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 15px rgba(6, 182, 212, 0.3);
    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
    --container-width: 1280px;
    --header-height: 80px;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--white);
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2.25rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Container */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    letter-spacing: -0.02em;
}

.logo span {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--white);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--white);
    background: none;
    border: none;
    cursor: pointer;
}

/* Hero Section */
.hero {
    padding: 180px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, rgba(139, 92, 246, 0.05) 70%, transparent 100%);
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 3rem;
}

.cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-gradient);
    color: var(--white);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.5);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-color);
}

/* Sections General */
section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    margin-bottom: 1rem;
}

.bg-secondary {
    background-color: var(--secondary-color);
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transition: all 0.8s ease-out;
}

.reveal.active {
    animation: fadeInUp 0.8s forwards;
}

/* ZigZag Layout */
.zigzag-section {
    padding: 4rem 0;
    overflow: visible;
    /* Allow decorative elements to bleed */
}

.zigzag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Better spacing */
    gap: 6rem;
    /* Increased gap */
    margin-bottom: 8rem;
    position: relative;
}

.zigzag-item:nth-child(even) {
    flex-direction: row-reverse;
}

.zigzag-content {
    flex: 0 0 45%;
    /* Fixed width for text */
}

.zigzag-content h3 {
    font-size: 2.5rem;
    /* Larger headings */
    margin-bottom: 1.5rem;
    color: var(--text-color);
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.zigzag-content p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.zigzag-image {
    flex: 0 0 50%;
    /* Fixed width for image container */
    position: relative;
}

/* Decorative backdrop for images */
.zigzag-image::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: 20px;
    bottom: 20px;
    border: 2px solid var(--accent-color);
    border-radius: 24px;
    z-index: 0;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.zigzag-item:nth-child(even) .zigzag-image::before {
    left: 20px;
    right: -20px;
}

.zigzag-image:hover::before {
    top: -10px;
    left: -10px;
    border-color: var(--brand-color);
    opacity: 0.6;
}

.zigzag-image img {
    width: 100%;
    max-width: 600px;
    /* Limit max width */
    height: auto;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.zigzag-image:hover img {
    transform: scale(1.02) translateY(-10px);
}

/* --- PREMIUM LIST STYLING (ZigZag) --- */
.zigzag-content ul li {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, background 0.3s ease;
}

.zigzag-content ul li:hover {
    transform: translateX(10px);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-color);
}

.zigzag-content ul li i {
    font-size: 1.2rem;
    background: rgba(6, 182, 212, 0.2);
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 15px;
    color: var(--accent-color) !important;
    /* Force color */
}

/* Service Header (New Class) */
.service-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.service-header h3 {
    margin-bottom: 0;
    line-height: 1.2;
}

.service-header .service-icon {
    font-size: 1.75rem;
    margin-bottom: 0;
    color: var(--accent-color);
}

.service-header .icon-box-glow {
    flex-shrink: 0;
}


/* --- STATS SECTION OVERHAUL --- */
.stats-section {
    padding: 8rem 0;
    position: relative;
    /* Animated Gradient Background */
    background: linear-gradient(-45deg, #0f172a, #1e293b, #0f172a);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 Columns Desktop */
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 2.5rem 1.5rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}

.stat-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-color), var(--brand-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -10px rgba(6, 182, 212, 0.2);
    background: rgba(255, 255, 255, 0.08);
    /* Lighter on hover */
}

.stat-item:hover::before {
    opacity: 1;
}

.stat-item h4 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.stat-item p {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Icon Glow Effect for Services */
.icon-box-glow {
    width: 60px;
    height: 60px;
    background: rgba(6, 182, 212, 0.1);
    /* Cyan low opacity */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(6, 182, 212, 0.3);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
    transition: all 0.3s ease;
}

.zigzag-item:hover .icon-box-glow {
    background: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-color);
    transform: rotate(5deg);
}

.zigzag-item:hover .icon-box-glow i {
    color: #fff !important;
}

/* --- SERVICE CARDS (PREMIUM GLASS) --- */
.service-card {
    background: rgba(30, 41, 59, 0.6);
    /* Semi-transparent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3rem 2rem;
    border-radius: 24px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Hover Glow Effect */
.service-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.2), transparent 40%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

.service-card h3 {
    margin-bottom: 1rem;
}

/* Contact Form */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info-card {
    background: var(--secondary-color);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.contact-details h3 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
    font-size: 1.2rem;
}

.contact-details p {
    font-size: 1rem;
    color: var(--text-muted);
}

.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
    /* Ensure group takes full width */
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    box-sizing: border-box;
    /* Important for padding */
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

/* Footer */
footer {
    background: var(--secondary-color);
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-brand h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
    display: block;
}

.footer-links h3 {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.footer-links ul li {
    margin-bottom: 0.75rem;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Floating WhatsApp */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: var(--secondary-color);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    z-index: 2000;
    transition: bottom 0.5s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.cookie-banner.active {
    bottom: 0;
}

.cookie-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.cookie-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    flex: 1;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
}

.btn-small {
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .contact-wrapper,
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        /* Full height minus header */
        background: var(--secondary-color);
        /* Solid background */
        flex-direction: column;
        padding: 2rem;
        gap: 2rem;
        transform: translateX(100%);
        /* Side slide instead of top */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-bottom: none;
        overflow-y: auto;
    }

    .nav-menu.active {
        transform: translateX(0);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .mobile-toggle {
        display: block;
        z-index: 1001;
    }

    .hero {
        padding: 140px 0 60px;
        overflow: hidden;
        /* Ensure hero doesn't overflow */
    }

    .hero h1 {
        font-size: 2.5rem;
        /* Smaller heading on mobile */
    }

    /* Fix Hero Blob Overflow */
    .hero::before {
        width: 300px;
        height: 300px;
        right: -50px;
        top: -50px;
        filter: blur(60px);
    }

    /* Stats Grid Mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        /* Stack stats */
        gap: 1.5rem;
    }

    /* ZigZag Mobile Stack */
    .zigzag-item,
    .zigzag-item:nth-child(even) {
        flex-direction: column;
        gap: 3rem;
        text-align: center;
    }

    .zigzag-content {
        flex: 0 0 100%;
        order: 1;
        /* Content first */
    }

    .zigzag-image {
        flex: 0 0 100%;
        order: 2;
        /* Image second */
    }

    .zigzag-content ul {
        text-align: left;
        /* Keep list aligned left */
        display: inline-block;
    }

    /* Mobile Service Header Alignment */
    .service-header {
        justify-content: center;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    /* Contact & Footer Stacking */
    .contact-wrapper,
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .cookie-content {
        flex-direction: column;
        align-items: center;
        /* Center align */
        text-align: center;
        gap: 1.5rem;
    }

    .cookie-buttons {
        width: 100%;
        flex-direction: column;
        /* Stack buttons */
    }

    .cookie-buttons .btn {
        width: 100%;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .zigzag-item {
        gap: 3rem;
    }
}

/* Legal Pages Specific */
.legal-content {
    background: var(--secondary-color);
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.legal-content h1 {
    margin-bottom: 2rem;
    color: var(--accent-color);
}

.legal-content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.legal-content a {
    color: var(--accent-dark);
    text-decoration: underline;
}

.legal-content a:hover {
    color: var(--primary-color);
}

/* --- ACCESSIBILITY WIDGET --- */
.a11y-trigger {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.a11y-trigger:hover,
.a11y-trigger.active {
    background: var(--accent-color);
    transform: scale(1.1);
}

.a11y-menu {
    position: fixed;
    bottom: 160px;
    right: 30px;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 12px;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 999;
}

.a11y-menu.visible {
    display: flex;
    animation: fadeInUp 0.3s forwards;
}

.a11y-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.a11y-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

/* High Contrast Mode Override */
body.high-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

body.high-contrast * {
    background-color: #000 !important;
    color: #fff !important;
    border-color: #fff !important;
    box-shadow: none !important;
}

body.high-contrast a {
    color: #ffff00 !important;
    /* Yellow for links */
    text-decoration: underline !important;
}

body.high-contrast .btn,
body.high-contrast button {
    background: #000 !important;
    border: 2px solid #fff !important;
    color: #fff !important;
}

body.high-contrast img {
    filter: grayscale(100%) contrast(150%);
}