/* ========================================
   Appstracta - Main CSS
   Estilos comunes para todas las páginas
   ======================================== */

/* Variables CSS */
:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --text: #333;
    --gray: #95a5a6;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --shadow: 0 10px 30px rgba(0,0,0,0.1);
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--light);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 35px;
}

nav ul li a {
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

nav ul li a:hover {
    color: var(--accent);
}

nav ul li a:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.mobile-menu {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 10px 25px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--accent);
    color: white;
    padding: 15px 35px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(231, 76, 60, 0.3);
}

.btn-primary:hover {
    background-color: #c0392b;
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(231, 76, 60, 0.4);
}

/* ========================================
   SECTIONS
   ======================================== */

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 80px;
}

.section-subtitle {
    display: inline-block;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 20px;
}

.section-desc {
    color: var(--gray);
    font-size: 1.1rem;
}

/* ========================================
   HERO SECTION (Index)
   ======================================== */

.hero {
    background: var(--gradient);
    color: white;
    padding: 180px 0 120px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('images/hero-bg.webp') center/cover,
                url('images/hero-bg.png') center/cover;
    opacity: 0.1;
}

.hero-content {
    max-width: 700px;
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    margin-bottom: 25px;
    border: 1px solid rgba(255,255,255,0.2);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 25px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-visual {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-mockup {
    width: 280px;
    height: 560px;
    background: #2c3e50;
    border-radius: 40px;
    border: 12px solid #2c3e50;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.4);
    animation: float 6s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mockup-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 28px;
    background: white;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.mobile-logo {
    display: none;
    text-align: center;
    margin-bottom: 20px;
}

.mobile-logo-img {
    height: 480px;
    width: auto;
    margin: 0 auto;
}

/* ========================================
   APPS SECTION
   ======================================== */

.apps {
    padding: 120px 0;
    background: var(--light);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.app-card {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-align: center;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.app-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.app-card:hover::before {
    transform: scaleX(1);
}

.app-logo {
    width: 100px;
    height: 100px;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: rgba(231, 76, 60, 0.1);
}

.app-logo img {
    max-width: 80%;
    max-height: 80%;
}

.app-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary);
}

.app-card p {
    color: var(--gray);
    margin-bottom: 25px;
}

.app-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: var(--transition);
    padding: 10px 20px;
    border: 2px solid var(--primary);
    border-radius: 25px;
}

.app-link:hover {
    background: var(--primary);
    color: white;
    gap: 12px;
    transform: translateY(-2px);
}

.app-link.coming-soon {
    background: var(--gray);
    border-color: var(--gray);
    color: white;
    cursor: not-allowed;
}

.app-link.coming-soon:hover {
    background: var(--gray);
    transform: none;
    gap: 8px;
}

.app-link.premium-link {
    background: linear-gradient(135deg, #FFC107 0%, #FF9800 100%);
    border-color: transparent;
    color: var(--text);
}

.app-link.premium-link:hover {
    background: linear-gradient(135deg, #FFB300 0%, #F57C00 100%);
    transform: translateY(-2px);
}

/* Multiple app links container */
.app-links {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   PORTFOLIO SECTION
   ======================================== */

.portfolio {
    padding: 120px 0;
    background: white;
}

.portfolio-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 60px;
}

.portfolio-controls {
    display: flex;
    gap: 15px;
}

.portfolio-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--light);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--primary);
}

.portfolio-btn:hover {
    background: var(--primary);
    color: white;
}

.portfolio-grid {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
}

.portfolio-grid::-webkit-scrollbar {
    display: none;
}

.portfolio-grid {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.portfolio-card {
    flex: 0 0 calc(100% - 60px);
    max-width: 400px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: white;
    scroll-snap-align: center;
}

.portfolio-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.portfolio-img {
    height: 240px;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.portfolio-img img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.portfolio-img::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.7);
    opacity: 0;
    transition: var(--transition);
}

.portfolio-card:hover .portfolio-img::after {
    opacity: 1;
}

.portfolio-content {
    padding: 25px;
}

.portfolio-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.portfolio-content p {
    color: var(--gray);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    background: rgba(231, 76, 60, 0.1);
    color: var(--accent);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.portfolio-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    padding: 8px 16px;
    border: 2px solid var(--primary);
    border-radius: 20px;
}

.portfolio-link:hover {
    background: var(--primary);
    color: white;
    gap: 12px;
}

.portfolio-link.coming-soon {
    background: var(--gray);
    border-color: var(--gray);
    color: white;
    cursor: not-allowed;
}

.portfolio-link.coming-soon:hover {
    background: var(--gray);
    transform: none;
    gap: 8px;
}

/* Multiple portfolio links container */
.portfolio-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Carousel Dots */
.portfolio-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.portfolio-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--light);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.portfolio-dot.active {
    background: var(--accent);
    transform: scale(1.2);
}

.portfolio-dot:hover {
    background: var(--primary);
}

/* ========================================
   STATS SECTION
   ======================================== */

.stats {
    padding: 100px 0;
    background: var(--gradient);
    color: white;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.stat-item {
    padding: 30px 20px;
}

.stat-number {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(to right, #fff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-text {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* ========================================
   CTA SECTION
   ======================================== */

.cta {
    padding: 120px 0;
    background: white;
    text-align: center;
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

.cta h2 {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
    line-height: 1.2;
}

.cta p {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 40px;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
    background: var(--primary);
    color: white;
    padding: 80px 0 30px;
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 50px;
    margin-bottom: 60px;
}

.footer-col h3 {
    font-size: 1.2rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent);
}

.footer-about p {
    opacity: 0.7;
    margin-bottom: 25px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
    transition: var(--transition);
    text-decoration: none;
}

.social-links a:hover {
    background-color: var(--accent);
    transform: translateY(-3px);
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-col ul li a:hover {
    color: white;
    padding-left: 5px;
}

.footer-newsletter p {
    opacity: 0.7;
    margin-bottom: 20px;
}

.newsletter-form {
    display: flex;
    margin-bottom: 20px;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 15px;
    border: none;
    border-radius: 5px 0 0 5px;
    background: rgba(255,255,255,0.1);
    color: white;
}

.newsletter-form input::placeholder {
    color: rgba(255,255,255,0.5);
}

.newsletter-form button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0 20px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-form button:hover {
    background: #c0392b;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1200px) {
    .hero h1 {
        font-size: 3rem;
    }

    .section-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 992px) {
    .footer-container {
        grid-template-columns: 1fr 1fr;
    }

    .hero-visual {
        display: none;
    }

    .hero {
        text-align: center;
        padding: 150px 0 100px;
    }

    .hero-content {
        max-width: 100%;
    }

    .mobile-logo {
        display: block;
    }
}

@media (max-width: 768px) {
    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    }

    .mobile-menu {
        display: block;
    }

    .header-actions {
        display: none;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .apps-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .footer-container {
        grid-template-columns: 1fr;
    }

    .mobile-logo-img {
        height: 180px;
    }
}

@media (max-width: 576px) {
    .hero h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .cta h2 {
        font-size: 2rem;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 6px 15px;
    }
}

/* Portfolio carousel - mostrar más cards en pantallas grandes */
@media (min-width: 768px) {
    .portfolio-card {
        flex: 0 0 calc(50% - 20px);
        max-width: 350px;
    }
}

@media (min-width: 1200px) {
    .portfolio-card {
        flex: 0 0 calc(33.333% - 20px);
        max-width: 350px;
    }
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

/* Clases base para animación */
.fade-in,
.fade-in-up,
.fade-in-left,
.fade-in-right,
.scale-in {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in {
    opacity: 0;
}

.fade-in-up {
    transform: translateY(30px);
}

.fade-in-left {
    transform: translateX(-30px);
}

.fade-in-right {
    transform: translateX(30px);
}

.scale-in {
    transform: scale(0.9);
}

/* Estado activo cuando es visible */
.fade-in.visible,
.fade-in-up.visible,
.fade-in-left.visible,
.fade-in-right.visible,
.scale-in.visible {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* Delays escalonados para elementos en grid */
.fade-in-up:nth-child(1) { transition-delay: 0ms; }
.fade-in-up:nth-child(2) { transition-delay: 100ms; }
.fade-in-up:nth-child(3) { transition-delay: 200ms; }
.fade-in-up:nth-child(4) { transition-delay: 300ms; }

/* Secciones específicas */
.section-header .fade-in-up {
    transition-delay: 0ms;
}

.app-card,
.portfolio-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.app-card.visible,
.portfolio-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.stat-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stat-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.stat-item:nth-child(1) { transition-delay: 0ms; }
.stat-item:nth-child(2) { transition-delay: 100ms; }
.stat-item:nth-child(3) { transition-delay: 200ms; }
.stat-item:nth-child(4) { transition-delay: 300ms; }

/* Footer columns */
.footer-col {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.footer-col.visible {
    opacity: 1;
    transform: translateY(0);
}

.footer-col:nth-child(1) { transition-delay: 0ms; }
.footer-col:nth-child(2) { transition-delay: 100ms; }
.footer-col:nth-child(3) { transition-delay: 200ms; }
.footer-col:nth-child(4) { transition-delay: 300ms; }
