/* --- RESET & VARIABLES --- */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #0ea5e9;
    --accent-hover: #0284c7;
    --border-color: #334155;
    --max-width: 1200px;
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

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

/* --- HERO SECTION --- */
.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: center;
    padding: 2rem 0;
}

@media (min-width: 900px) {
    .hero {
        grid-template-columns: 1fr 1.1fr; 
        gap: 1.5rem;
    }
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.brand h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.hero-text p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 540px;
}

/* Botones */
.buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.button {
    display: inline-block;
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.button.primary {
    background-color: var(--accent);
    color: #ffffff;
}

.button.primary:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
}

.button.secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.button.secondary:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-secondary);
}

/* Video Showcase */
.showcase video {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
    display: block;
}

/* --- FEATURES SECTION --- */
.features {
    padding: 4rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

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

.feature {
    background-color: rgba(30, 41, 59, 0.35); 
    padding: 1.25rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.06); 
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.feature:hover {
    transform: translateY(-3px);
    border-color: rgba(14, 165, 233, 0.4);
    background-color: rgba(30, 41, 59, 0.55);
}

.feature h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.feature video {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: calc(var(--radius) - 6px);
    border: none; 
    margin-bottom: 1rem;
    display: block;
}

.feature-card-interactive img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: calc(var(--radius) - 6px);
    border: none; 
    margin-bottom: 1rem;
    display: block;
}

.feature-card-interactive {
    cursor: pointer;
    user-select: none;
}

.feature-card-interactive:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 10px 25px -5px rgba(14, 165, 233, 0.15);
}

.tech-badge {
    font-family: inherit;
    font-weight: 600;
    color: var(--accent);
    background-color: rgba(14, 165, 233, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(14, 165, 233, 0.2);
    font-size: 0.85em;
    letter-spacing: 0.03em;
}

/* --- COMMUNITY & MAIL SECTION --- */
.community-section {
    padding: 4rem 0;
    border-top: 1px solid var(--border-color); 
}

.community-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
}

.open-source-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.open-source-content .tech-badge {
    margin-bottom: 0.75rem;
}

.open-source-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.open-source-content p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.btn-github {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.8rem;
    background-color: rgba(255, 255, 255, 0.03);
}

.btn-github:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.mail-list {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
}

.mail-list::before {
    content: '';
    position: absolute;
    left: -1.5rem; 
    top: 10%;
    height: 80%;
    width: 1px;
    background-color: var(--border-color);
    opacity: 0.6;
}

@media (max-width: 900px) {
    .community-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .open-source-content {
        align-items: center;
        text-align: center;
    }

    .mail-list::before {
        left: 10%;
        top: -1.5rem;
        width: 80%;
        height: 1px;
    }
}

/* --- MODAL SECTION --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 1.5rem;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    max-width: 600px;
    width: 100%;
    padding: 2rem;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-backdrop.active .modal-container {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content {
    display: none;
}

.modal-content.active {
    display: block;
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-content p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- OVERVIEW & VIEWER LAYOUT --- */
.outputs-overview h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.outputs-overview p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

/* Viewer Container */
.viewer-container {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: calc(var(--radius) - 2px);
    overflow: hidden;
}

/* Tabs */
.viewer-tabs {
    display: flex;
    background-color: rgba(15, 23, 42, 0.6);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background-color: rgba(14, 165, 233, 0.05);
}

/* Panels */
.viewer-display {
    padding: 1rem;
    min-height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-panel {
    display: none;
    width: 100%;
    height: 100%;
}

.preview-panel.active {
    display: block;
}

/* --- MODAL WIDE SIZE --- */
.modal-container.modal-lg {
    max-width: 820px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.viewer-display {
    padding: 1rem;
    min-height: 520px;
}

#preview-pdf embed,
#preview-pdf iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 4px;
}

.downloads-list {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

#modal-outputs ul {
    margin: 1rem 0 1.5rem 1.2rem;
    padding: 0;
    color: #94a3b8;
}

#modal-outputs li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

#modal-outputs li strong {
    color: #f8fafc;
}

body.no-scroll {
    overflow: hidden;
}

.modal-container.modal-lg {
    max-width: 820px;
    width: 90%;
}

#modal-components .components-grid {
    display: flex !important;
    gap: 1.5rem !important;
    align-items: flex-start !important;
    margin-top: 1rem !important;
}

#modal-components .components-text {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
}

#modal-components .components-text p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: #94a3b8;
}

#modal-components .components-media {
    flex: 0 0 350px !important;
    width: 350px !important;
    max-width: 350px !important;
}

#modal-components .components-media img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #050914;
}

.feature-card-interactive .card-media-wrapper {
    position: relative;
    display: block;
    border-radius: 8px;
    overflow: hidden;
}

.feature-card-interactive .card-media-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.3s ease;
}

.feature-card-interactive:hover .card-media-wrapper img {
    filter: brightness(0.6);
}

.feature-card-interactive .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    width: 64px;
    height: 64px;
    background-color: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    opacity: 0.9;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.feature-card-interactive .play-icon svg {
    width: 40px;
    height: 40px;
}

.feature-card-interactive:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background-color: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 1);
    opacity: 1;
}

.modal-container.modal-xl {
    max-width: 1100px !important;
    width: 90vw !important;
    max-height: 88vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 2rem !important;
}

#modal-iteration {
    display: none !important;
}

#modal-iteration.active {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    align-items: stretch !important;
}

.modal-container.modal-xl {
    max-width: 1100px !important;
    width: 90vw !important;
    max-height: 88vh !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 2rem !important;
}

#modal-iteration h2 {
    margin-bottom: 1rem !important;
    flex: 0 0 auto !important;
}

#modal-iteration .modal-video-wrapper {
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    border-radius: 8px;
    overflow: hidden;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-iteration .modal-video-wrapper video {
    width: 100% !important;
    height: auto !important;
    max-height: 70vh !important;
    display: block !important;
    object-fit: contain !important;
}

@media (max-width: 800px) {
    #modal-components .components-grid {
        flex-direction: column !important;
    }

    #modal-components .components-media {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}
