/* vMix Tools Portal Design System */

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

:root {
    /* Colors */
    --bg-color: #050507;
    --card-bg: rgba(26, 26, 30, 0.7);
    --accent-blue: #00d2ff;
    --accent-purple: #9d50bb;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a8;
    --border-color: rgba(255, 255, 255, 0.1);
    --glow-color: rgba(0, 210, 255, 0.2);
    
    /* Spacing & Borders */
    --radius-lg: 20px;
    --radius-md: 12px;
    --container-width: 1200px;
    
    /* Animation */
    --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.4;
    overflow: hidden;
    position: relative;
    height: 100vh;
    width: 100vw;
}

/* Dynamic Background Blobs */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(100px);
    opacity: 0.6;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: var(--accent-blue);
    opacity: 0.3;
}

.blob:nth-child(1) {
    top: -100px;
    left: -100px;
    background: var(--accent-purple);
    animation: move-1 17.5s infinite alternate ease-in-out;
}

.blob:nth-child(2) {
    bottom: -100px;
    right: -100px;
    background: var(--accent-blue);
    animation: move-2 21s infinite alternate ease-in-out;
}

.blob:nth-child(3) {
    top: 50%;
    left: 40%;
    background: #4a00e0;
    animation: move-3 24.5s infinite alternate ease-in-out;
}

@keyframes move-1 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(20vw, 30vh) scale(1.2); }
}

@keyframes move-2 {
    from { transform: translate(0, 0) scale(1.2); }
    to { transform: translate(-25vw, -20vh) scale(1); }
}

@keyframes move-3 {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(15vw, -25vh) scale(1.3); }
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Hero */
header {
    padding: 5vh 0 2vh; /* Reduced top gap and reduced bottom gap to cards */
    text-align: center;
}

h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 8vh;
    font-weight: 900;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h1 .light {
    font-weight: 300;
}

.subtitle {
    font-family: 'Poppins', sans-serif;
    font-weight: 300;
    color: var(--text-secondary);
    font-size: 2vh;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

.slider-wrapper {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    padding: 6vh 0 12vh; /* Reduced from 10vh top. 6vh safely fits the 1.15 scale */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) rgba(255,255,255,0.05);
}

/* Magic: safely centers app-grid if it fits, allows pure scrolling if it overflows */
.slider-wrapper::before,
.slider-wrapper::after {
    content: '';
    margin: auto;
    min-width: 5vw; /* Fuerza un espacio lateral inquebrantable para el scroll terminal */
}

/* Stylish Scrollbar for Webkit */
.slider-wrapper::-webkit-scrollbar {
    height: 8px;
}
.slider-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}
.slider-wrapper::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 4px;
}

.app-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 4rem;
    align-items: stretch; /* Forces all cards to be the exact same height visually */
    padding: 0; /* Espaciado lateral manejado por los min-width del wrapper */
}

@media (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
        width: 100%;
        background: linear-gradient(180deg, #050507 0%, #0c0c14 100%) !important;
    }
    .lang-toggle {
        top: 1rem;
        left: 1rem;
    }
    .container {
        height: auto;
        padding: 2rem 1rem;
    }
    header {
        padding: 4rem 0 2rem;
    }
    h1 {
        font-size: 3rem;
    }
    .subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
    .slider-wrapper {
        display: block;
        width: 100%;
        margin-left: 0;
        overflow: visible;
        padding: 0;
    }
    .slider-wrapper::before,
    .slider-wrapper::after {
        display: none;
    }
    .app-grid {
        flex-direction: column;
        gap: 2rem;
        padding: 2rem 0;
        overflow: visible;
        width: 100%;
        margin-left: 0;
    }
    /* Stop expensive background animations */
    .bg-blobs {
        display: none !important;
    }
    /* Disable hover effects and expensive filters on mobile */
    .hover-3d {
        display: block;
        max-width: 100%;
        width: 100% !important;
        transform: none !important;
    }
    .hover-3d:first-child {
        margin-left: 0 !important;
    }
    .hover-3d:last-child {
        margin-right: 0 !important;
    }
    .hover-3d:hover .app-card {
        transform: none !important;
        scale: 1 !important;
        box-shadow: 0 15px 30px rgba(0,0,0,0.4) !important;
    }
    .app-card {
        max-width: 100%;
        pointer-events: auto;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: #15151a !important;
        transform: none !important;
        transition: none !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    footer {
        position: relative;
        background: none;
    }
}

/* Card Hover System */
.hover-3d {
    position: relative;
    cursor: pointer;
    flex: 0 0 auto;
    width: 480px;
    max-width: 90vw;
    scroll-snap-align: center;
    text-decoration: none;
    color: inherit;
    display: block;
}

.app-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    position: relative;
    will-change: transform;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.4s ease-out, border-color 0.4s ease-out;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Base hover state */
.hover-3d:hover .app-card {
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8), 0 0 40px rgba(0, 210, 255, 0.4);
    border-color: rgba(0, 210, 255, 0.6);
    transform: scale(1.15);
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent, rgba(0, 210, 255, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.card-image-container {
    width: 100%;
    aspect-ratio: 16/9; /* Fix image proportion rigidly */
    flex: 0 0 auto; /* Prevent image from stretching vertically to fill the card */
    overflow: hidden;
    background: #111;
    position: relative;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
}

.card-image-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.4));
    pointer-events: none;
}

.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.card-content {
    padding: 2rem;
    flex-grow: 1; /* Fills empty space if text is shorter */
}

.card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5vh;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-description {
    color: var(--text-secondary);
    font-size: 1.6vh;
    font-weight: 400;
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 6vh 1rem 3vh; /* Increased top padding to stretch the gradient */
    text-align: center;
    background: linear-gradient(to top, var(--bg-color) 35%, rgba(5,5,7,0.85) 60%, transparent 100%);
    z-index: 50;
    pointer-events: none; /* Let clicks pass through the invisible gradient part */
}

footer > * {
    pointer-events: auto; /* Keep text and links clickable */
}

.footer-dev {
    font-size: 0.75rem; /* Reduced font size to avoid touching sides */
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding: 0 1rem; /* Prevent touching edges on small devices */
}

.footer-email {
    font-weight: 600;
    color: var(--accent-blue);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.footer-email:hover {
    text-shadow: 0 0 10px var(--accent-blue);
}

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

.fade-in {
    animation: fadeInUp 0.8s var(--transition-smooth) both;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* Language Toggle */
.lang-toggle {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(26, 26, 30, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 0.2rem;
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-btn.active {
    color: var(--accent-blue);
}

.lang-divider {
    color: var(--border-color);
    font-size: 0.9rem;
}
