/**
 * Sections CSS
 *
 * Section-specific styling for all page sections.
 *
 * @package Groupetto_2026
 */

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: calc(var(--header-height) + var(--space-2xl));
    padding-bottom: var(--space-3xl);
    background: var(--gradient-hero);
    overflow: hidden;
}

.hero__background {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Subtle glow effect */
.hero__glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(ellipse at center, rgba(230, 57, 70, 0.15) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(40px);
}

/* Grid pattern overlay */
.hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.5;
}

.hero__content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    text-align: center;
    padding-inline: var(--space-lg);
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background-color: rgba(230, 57, 70, 0.15);
    color: var(--color-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    border-radius: var(--border-radius-full);
    border: 1px solid rgba(230, 57, 70, 0.3);
    margin-bottom: var(--space-lg);
}

.hero__badge-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.hero__title {
    margin-bottom: var(--space-lg);
    color: var(--color-text);
}

.hero__title-highlight {
    color: var(--color-primary);
}

.hero__description {
    font-size: var(--font-size-lg);
    color: var(--color-text-light);
    margin-bottom: var(--space-2xl);
    max-width: 600px;
    margin-inline: auto;
}

.hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
}

.hero__scroll {
    position: absolute;
    bottom: var(--space-2xl);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    animation: bounce 2s infinite;
}

.hero__scroll-icon {
    width: 24px;
    height: 40px;
    border: 2px solid var(--color-text-muted);
    border-radius: var(--border-radius-full);
    position: relative;
}

.hero__scroll-icon::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background-color: var(--color-text-muted);
    border-radius: var(--border-radius-full);
    animation: scroll-indicator 2s infinite;
}

/* ==========================================================================
   Buttons (used across sections)
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    text-align: center;
    border-radius: var(--border-radius-full);
    transition: all var(--transition-base);
    cursor: pointer;
}

.btn--primary {
    background-color: var(--color-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(230, 57, 70, 0.4);
}

.btn--primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.5);
}

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

.btn--secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn--large {
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--font-size-md);
}

/* ==========================================================================
   App Demo Section
   ========================================================================== */

.app-demo {
    background-color: var(--color-bg);
}

.app-demo__container {
    display: grid;
    gap: var(--space-3xl);
    align-items: center;
}

.app-demo__content {
    max-width: 500px;
}

.app-demo__title {
    margin-bottom: var(--space-md);
}

.app-demo__description {
    margin-bottom: var(--space-xl);
}

.app-demo__features {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.app-demo__feature {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.app-demo__feature-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(230, 57, 70, 0.1);
    color: var(--color-primary);
    border-radius: var(--border-radius-md);
}

.app-demo__feature-text h4 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-xs);
}

.app-demo__feature-text p {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

/* Phone Mockup */
.app-demo__mockup {
    position: relative;
    display: flex;
    justify-content: center;
}

.phone-mockup {
    position: relative;
    width: 280px;
    height: 580px;
    background-color: var(--color-text);
    border-radius: 40px;
    padding: 12px;
    box-shadow: var(--shadow-2xl);
}

.dark-mode .phone-mockup {
    background-color: #000;
}

.phone-mockup__notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 28px;
    background-color: var(--color-text);
    border-radius: 0 0 16px 16px;
    z-index: 10;
}

.dark-mode .phone-mockup__notch {
    background-color: #000;
}

.phone-mockup__screen {
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-card);
    border-radius: 32px;
    overflow: hidden;
    position: relative;
}

/* App Screen Content */
.app-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: var(--space-lg);
    padding-top: calc(28px + var(--space-lg));
}

.app-screen__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.app-screen__greeting {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.app-screen__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
}

.app-screen__avatar {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
}

/* Stats Card */
.app-screen__stats-card {
    background: var(--gradient-primary);
    border-radius: var(--border-radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
    color: white;
}

.stats-card__label {
    font-size: var(--font-size-xs);
    opacity: 0.8;
    margin-bottom: var(--space-xs);
}

.stats-card__value {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    font-style: normal;
    margin-bottom: var(--space-sm);
    font-variant-numeric: tabular-nums;
}

.stats-card__progress {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-full);
    overflow: hidden;
}

.stats-card__progress-bar {
    height: 100%;
    background-color: white;
    border-radius: var(--border-radius-full);
    width: 0;
    transition: width 1.5s ease-out;
}

/* Workout List */
.app-screen__workouts {
    flex: 1;
}

.workouts__title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-md);
    color: var(--color-text);
}

.workout-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-md);
    margin-bottom: var(--space-sm);
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.workout-item.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.workout-item__icon {
    width: 36px;
    height: 36px;
    background-color: rgba(230, 57, 70, 0.15);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
}

.workout-item__info {
    flex: 1;
}

.workout-item__name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
}

.workout-item__details {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.workout-item__duration {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    font-style: normal;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Stats Section
   ========================================================================== */

.stats {
    background-color: var(--color-bg);
    text-align: center;
}

.stats__grid {
    display: grid;
    gap: var(--space-xl);
}

.stat-card {
    padding: var(--space-xl);
    background-color: var(--color-bg-card);
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--color-border);
    transition: transform var(--transition-base),
                border-color var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
}

.stat-card__icon {
    width: 60px;
    height: 60px;
    margin-inline: auto;
    margin-bottom: var(--space-md);
    background-color: rgba(230, 57, 70, 0.1);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card__icon svg {
    width: 28px;
    height: 28px;
    color: var(--color-primary);
}

.stat-card__number {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-normal);
    font-style: normal;
    color: var(--color-text);
    line-height: 1;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
}

.stat-card__number .counter {
    display: inline-block;
    font-family: var(--font-family-mono);
    font-variant-numeric: tabular-nums;
}

.stat-card__label {
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
}

/* ==========================================================================
   News Banner Section (Dark Theme)
   ========================================================================== */

.news-banner {
    background-color: var(--color-bg-card);
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding-block: var(--space-lg);
    overflow: hidden;
}

.news-banner__track {
    display: flex;
    width: max-content;
    animation: ticker 30s linear infinite;
}

.news-banner__track:hover {
    animation-play-state: paused;
}

.news-banner__item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-inline: var(--space-2xl);
    white-space: nowrap;
    color: var(--color-text);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
}

.news-banner__item::before {
    content: '';
    width: 8px;
    height: 8px;
    background-color: var(--color-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.news-banner__link {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.news-banner__link:hover {
    color: var(--color-primary-light);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ==========================================================================
   Download Section
   ========================================================================== */

.download {
    background-color: var(--color-bg);
    text-align: center;
}

.download__content {
    max-width: 600px;
    margin-inline: auto;
}

.download__title {
    margin-bottom: var(--space-md);
}

.download__description {
    margin-bottom: var(--space-2xl);
}

.download__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-xl);
}

.store-button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    background-color: var(--color-bg-card);
    color: white;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-border);
    transition: transform var(--transition-base),
                border-color var(--transition-base);
}

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

.store-button__icon {
    width: 32px;
    height: 32px;
}

.store-button__icon svg {
    width: 100%;
    height: 100%;
}

.store-button__text {
    text-align: left;
}

.store-button__label {
    font-size: var(--font-size-xs);
    opacity: 0.8;
    display: block;
}

.store-button__store {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

.download__trust {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-lg);
    justify-content: center;
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.download__trust-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.download__trust-item svg {
    width: 16px;
    height: 16px;
    color: var(--color-primary);
}

/* ==========================================================================
   Video Section
   ========================================================================== */

.video-section {
    background-color: var(--color-bg);
}

.video-section__device {
    max-width: 900px;
    margin-inline: auto;
}

.video-section__device--phone {
    max-width: 320px;
}

/* Device Frame - Phone (iPhone style) */
.device-frame--phone {
    position: relative;
    background-color: #1a1a1a;
    border-radius: 50px;
    padding: 12px;
    box-shadow: var(--shadow-2xl), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.device-frame--phone .device-frame__notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 28px;
    background-color: #1a1a1a;
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.device-frame--phone .device-frame__screen {
    width: 100%;
    aspect-ratio: 9 / 19.5;
    background-color: var(--color-bg-card);
    border-radius: 40px;
    overflow: hidden;
    margin: 0;
}

.device-frame--phone .device-frame__home-indicator {
    width: 120px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-full);
    margin: var(--space-sm) auto 0;
}

/* Phone Video Placeholder */
.video-placeholder--phone {
    height: 100%;
}

.video-placeholder__preview--phone {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg);
}

.phone-preview__status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px var(--space-lg) var(--space-sm);
    color: var(--color-text);
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
}

.phone-preview__icons {
    display: flex;
    gap: var(--space-xs);
    color: var(--color-text);
}

.phone-preview__header {
    padding: var(--space-sm) var(--space-lg);
}

.phone-preview__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
}

.phone-preview__stats-card {
    margin: var(--space-sm) var(--space-lg);
    padding: var(--space-md);
    background: var(--gradient-primary);
    border-radius: var(--border-radius-lg);
    color: white;
}

.phone-preview__stats-value {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    font-style: normal;
    font-variant-numeric: tabular-nums;
}

.phone-preview__stats-label {
    font-size: var(--font-size-xs);
    opacity: 0.8;
    margin-bottom: var(--space-sm);
}

.phone-preview__progress {
    height: 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-full);
    overflow: hidden;
}

.phone-preview__progress::after {
    content: '';
    display: block;
    width: 70%;
    height: 100%;
    background-color: white;
    border-radius: var(--border-radius-full);
    animation: progressFill 2s ease-out forwards;
}

@keyframes progressFill {
    from { width: 0; }
    to { width: 70%; }
}

.phone-preview__list {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.phone-preview__list-item {
    height: 50px;
    background-color: var(--color-bg-card);
    border-radius: var(--border-radius-md);
    animation: fadeInUp 0.5s ease-out both;
}

.phone-preview__list-item:nth-child(1) { animation-delay: 0.5s; }
.phone-preview__list-item:nth-child(2) { animation-delay: 0.7s; }
.phone-preview__list-item:nth-child(3) { animation-delay: 0.9s; }

@media (min-width: 768px) {
    .video-section__device--phone {
        max-width: 360px;
    }

    .device-frame--phone {
        padding: 14px;
        border-radius: 55px;
    }

    .device-frame--phone .device-frame__notch {
        width: 110px;
        height: 30px;
    }

    .device-frame--phone .device-frame__screen {
        border-radius: 44px;
    }
}

/* Video Container */
.video-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.video-wrapper--youtube {
    position: relative;
    width: 100%;
    height: 100%;
}

.video-wrapper--youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video Placeholder */
.video-placeholder {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.video-placeholder__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background-color: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.video-placeholder:hover .video-placeholder__content {
    opacity: 1;
}

.video-placeholder__play {
    width: 80px;
    height: 80px;
    background-color: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform var(--transition-base),
                background-color var(--transition-base);
    cursor: pointer;
}

.video-placeholder__play:hover {
    transform: scale(1.1);
    background-color: var(--color-primary-dark);
}

.video-placeholder__play svg {
    margin-left: 4px;
}

.video-placeholder__text {
    margin-top: var(--space-md);
    color: white;
    font-weight: var(--font-weight-semibold);
}

/* Animated App Preview */
.video-placeholder__preview {
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
}

.preview-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background-color: var(--color-bg-alt);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.preview-nav {
    display: flex;
    gap: 6px;
}

.preview-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.preview-dot--red {
    background-color: #ff5f57;
}

.preview-dot--yellow {
    background-color: #ffbd2e;
}

.preview-dot--green {
    background-color: #28ca41;
}

.preview-url {
    flex: 1;
    text-align: center;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    background-color: var(--color-bg);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--border-radius-sm);
}

.preview-content {
    display: flex;
    height: calc(100% - 40px);
}

.preview-sidebar {
    width: 60px;
    background-color: var(--color-text);
    padding: var(--space-md) var(--space-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.preview-menu-item {
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    transition: background-color var(--transition-fast);
}

.preview-menu-item.active {
    background-color: var(--color-primary);
}

.preview-main {
    flex: 1;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.preview-card {
    background-color: var(--color-bg-alt);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}

.preview-card--large {
    height: 120px;
    background: var(--gradient-primary);
    animation: pulse 3s infinite;
}

.preview-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    flex: 1;
}

.preview-cards .preview-card {
    animation: fadeInUp 0.5s ease-out both;
}

.preview-cards .preview-card:nth-child(1) {
    animation-delay: 0.5s;
}

.preview-cards .preview-card:nth-child(2) {
    animation-delay: 0.7s;
}

.preview-cards .preview-card:nth-child(3) {
    animation-delay: 0.9s;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (min-width: 768px) {
    .app-demo__container {
        grid-template-columns: 1fr 1fr;
    }

    .app-demo__mockup {
        order: 1;
    }

    .app-demo__content {
        order: 0;
    }

    .stats__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .phone-mockup {
        width: 300px;
        height: 620px;
    }
}

@media (min-width: 992px) {
    .hero__title {
        font-size: var(--font-size-5xl);
    }

    .hero__description {
        font-size: var(--font-size-xl);
    }
}
