/* Reset y variables CSS */
:root {
    /* Colores modo claro */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-primary: #3b82f6;
    --accent-secondary: #1d4ed8;
    --accent-light: #dbeafe;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
    --gradient-start: #3b82f6;
    --gradient-end: #1d4ed8;
}

[data-theme="dark"] {
    /* Colores modo oscuro */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --accent-primary: #60a5fa;
    --accent-secondary: #3b82f6;
    --accent-light: #1e40af;
    --border-color: #334155;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --card-bg: #1e293b;
    --gradient-start: #1e40af;
    --gradient-end: #3b82f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header/Hero Section */
.hero {
    background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    color: white;
    padding: 100px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 20px;
    opacity: 0.9;
}

.hero-description {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
    opacity: 0.9;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    justify-content: center;
}

.theme-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.theme-icon {
    font-size: 1.2rem;
}

/* Main Content */
.main-content {
    padding: 60px 0 100px;
    background-color: var(--bg-primary);
}

/* Features Section */
.features-section h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.section-description {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 60px;
    line-height: 1.7;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Special layout for 7 items: 3-3-1 centered */
.features-grid > :nth-child(7) {
    grid-column: 2 / span 1;
    justify-self: center;
    max-width: 400px;
}

@media (max-width: 1024px) {
    .features-grid > :nth-child(7) {
        grid-column: auto;
        justify-self: auto;
        max-width: none;
    }
}

/* Feature Cards */
.feature-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 8px 32px var(--shadow-color);
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--shadow-color);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.feature-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.feature-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.feature-content {
    margin-bottom: 30px;
    flex-grow: 1;
}

.feature-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 1rem;
    margin: 0;
}

/* Screenshots */
.feature-screenshots {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    background: var(--bg-tertiary);
    padding: 15px;
    margin: -5px;
    margin-top: 0;
}

.screenshot-container {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg-secondary);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.screenshot-container:hover {
    transform: scale(1.02);
}

.screenshot-container::after {
    content: "👆 Click para ver en grande";
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.screenshot-container:hover::after {
    opacity: 1;
}

.screenshot {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: var(--bg-tertiary);
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

.light-mode {
    opacity: 1;
}

.dark-mode {
    opacity: 0;
}

[data-theme="dark"] .light-mode {
    opacity: 0;
}

[data-theme="dark"] .dark-mode {
    opacity: 1;
}

/* Footer */
.footer {
    background-color: var(--bg-secondary);
    padding: 60px 0 30px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.footer-logo p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.footer-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--accent-primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        padding: 60px 0 40px;
        margin-bottom: 20px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .features-section h2 {
        font-size: 2rem;
    }

    .main-content {
        padding: 40px 0 60px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .feature-card {
        padding: 25px;
    }

    .feature-screenshots {
        padding: 10px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .feature-card {
        padding: 20px;
    }

    .theme-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feature-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }
.feature-card:nth-child(7) { animation-delay: 0.7s; }

.feature-card {
    opacity: 0;
}

/* Loading states */
.screenshot {
    transition: opacity 0.3s ease;
}

.screenshot[loading] {
    opacity: 0.5;
}

/* Gallery Modal */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-modal.active {
    display: block;
    opacity: 1;
}

.gallery-content {
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-modal.active .gallery-content {
    transform: scale(1) translateY(0);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    cursor: pointer;
}

.gallery-content {
    position: relative;
    max-width: 1400px;
    margin: 20px auto;
    background: var(--card-bg);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

.gallery-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.gallery-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.gallery-header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gallery-icon {
    font-size: 1.8rem;
    opacity: 0.8;
    background: var(--accent-light);
    padding: 8px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}

.gallery-theme-button {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.gallery-theme-button:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.gallery-close {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.gallery-image-container {
    position: relative;
    background: var(--bg-secondary);
    padding: 30px;
}

.gallery-image-container::before,
.gallery-image-container::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
    opacity: 0;
}

.gallery-image-container:hover::before,
.gallery-image-container:hover::after {
    opacity: 0.8;
}

.gallery-image-container:hover::before:hover,
.gallery-image-container:hover::after:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
    background: rgba(0, 0, 0, 0.8);
}

.gallery-image-container::before {
    left: 20px;
    content: '‹';
}

.gallery-image-container::after {
    right: 20px;
    content: '›';
}

.gallery-image {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease;
}

.gallery-theme-toggle {
    position: absolute;
    top: 20px;
    left: 20px;
}

.gallery-theme-button {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.gallery-theme-button:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.gallery-info {
    padding: 25px 40px;
    flex-shrink: 0;
    max-height: 350px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-primary) transparent;
}

.gallery-info::-webkit-scrollbar {
    width: 6px;
}

.gallery-info::-webkit-scrollbar-track {
    background: transparent;
}

.gallery-info::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 3px;
}

.gallery-info p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
    text-align: left;
}

.gallery-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px 30px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    position: relative;
}

.gallery-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.gallery-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.7;
    text-align: center;
}
}

.gallery-navigation::before {
    content: "💡 Haz clic en las capturas para explorar • Usa ← → para navegar • ESC para cerrar";
    position: absolute;
    top: -35px;
    left: 30px;
    right: 30px;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.gallery-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-width: 140px;
    justify-content: center;
}

.gallery-nav-btn:hover:not(:disabled) {
    background: var(--accent-secondary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.gallery-nav-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.gallery-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.nav-arrow {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
}

.nav-text {
    font-size: 0.95rem;
}

.gallery-indicators {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 500;
}

.gallery-separator {
    opacity: 0.7;
}

/* Gallery Responsive */
@media (max-width: 768px) {
    .gallery-content {
        margin: 10px;
        max-height: calc(100vh - 20px);
        border-radius: 16px;
    }

    .gallery-header-bar {
        padding: 15px 20px;
    }

    .gallery-title {
        font-size: 1.2rem;
    }

    .gallery-header-actions {
        gap: 10px;
    }

    .gallery-icon {
        font-size: 1.5rem;
        min-width: 35px;
        min-height: 35px;
        padding: 6px;
    }

    .gallery-theme-button,
    .gallery-close {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .gallery-image-container {
        padding: 15px;
    }

    .gallery-image {
        max-height: 35vh;
        border-radius: 8px;
    }

    .gallery-info {
        padding: 20px;
        max-height: 250px;
    }

    .gallery-info p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .gallery-navigation {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }

    .gallery-navigation::before {
        display: none; /* Hide hint on mobile */
    }

    .gallery-nav-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .gallery-indicators {
        order: -1; /* Show indicators first on mobile */
        margin-bottom: 10px;
    }
}

/* Navigation feedback animation */
@keyframes navigationFeedback {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
}