/* ============================================
   APP PAGE STYLES
   Individual app detail pages
   ============================================ */

/* Theme Colors */
.steller-theme {
    --app-primary: #3b82f6;
    --app-secondary: #1e3a8a;
    --app-glow: rgba(59, 130, 246, 0.4);
}

.trackthis-theme {
    --app-primary: #a855f7;
    --app-secondary: #7c3aed;
    --app-glow: rgba(168, 85, 247, 0.4);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   APP HERO SECTION
   ============================================ */
.app-hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 140px 24px 80px;
    overflow: hidden;
}

.app-hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.app-gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.steller-theme .app-gradient-orb.orb-1 {
    width: 500px;
    height: 500px;
    background: #3b82f6;
    top: -100px;
    right: -100px;
}

.steller-theme .app-gradient-orb.orb-2 {
    width: 400px;
    height: 400px;
    background: #06b6d4;
    bottom: -100px;
    left: -50px;
}

.trackthis-theme .app-gradient-orb.orb-1 {
    width: 500px;
    height: 500px;
    background: #a855f7;
    top: -100px;
    right: -100px;
}

.trackthis-theme .app-gradient-orb.orb-2 {
    width: 400px;
    height: 400px;
    background: #c026d3;
    bottom: -100px;
    left: -50px;
}

.app-hero-content {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 10;
}

.app-hero-info {
    display: flex;
    align-items: flex-start;
    gap: 48px;
}

.app-hero-icon {
    width: 120px;
    height: 120px;
    min-width: 120px;
    min-height: 120px;
    max-width: 120px;
    max-height: 120px;
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.app-hero-text {
    flex: 1;
}

.app-badge-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.app-badge {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.app-badge.new {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.app-badge.featured {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.app-hero-title {
    font-size: clamp(48px, 8vw, 72px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 8px;
}

.app-hero-subtitle {
    font-size: 20px;
    color: var(--app-primary);
    font-weight: 500;
    margin-bottom: 20px;
}

.app-hero-description {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 600px;
    margin-bottom: 32px;
}

.app-hero-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.hero-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-stat-stars {
    color: #fbbf24;
    display: flex;
}

.hero-stat-stars svg {
    width: 20px;
    height: 20px;
}

.hero-stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* App Store Button */
.app-store-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.app-store-btn:hover {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.app-store-btn .apple-logo {
    width: 28px;
    height: 28px;
}

.app-store-btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.app-store-btn-text .small {
    font-size: 10px;
    opacity: 0.8;
}

.app-store-btn-text .large {
    font-size: 18px;
    font-weight: 600;
}

.app-store-btn.large {
    padding: 18px 36px;
}

.app-store-btn.large .apple-logo {
    width: 32px;
    height: 32px;
}

.app-store-btn.large .app-store-btn-text .large {
    font-size: 20px;
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.app-features {
    padding: 100px 24px;
    background: var(--bg-secondary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 32px;
    transition: all 0.3s ease;
}

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

.feature-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-secondary) 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon svg {
    width: 28px;
    height: 28px;
    stroke: white;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================
   SCREENSHOTS SECTION
   ============================================ */
.app-screenshots {
    padding: 100px 24px;
    overflow: hidden;
}

.screenshots-gallery {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 24px;
    padding: 40px 0;
    perspective: 1000px;
}

.screenshot-item {
    position: relative;
    transition: all 0.4s ease;
}

.screenshot-item .phone-frame {
    width: 220px;
    height: 450px;
    background: linear-gradient(145deg, #2a2a2a 0%, #1a1a1a 100%);
    border-radius: 36px;
    padding: 8px;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.screenshot-item.featured .phone-frame {
    width: 260px;
    height: 530px;
}

.screenshot-item .phone-screen {
    width: 100%;
    height: 100%;
    border-radius: 28px;
    overflow: hidden;
    background: #0a0a0a;
}

.screenshot-item .phone-screen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 28px;
}

.screenshot-item:hover {
    transform: translateY(-10px);
}

/* Side screenshots positioning */
.screenshot-item:first-child:not(:only-child),
.screenshot-item:last-child:not(:only-child) {
    opacity: 0.85;
}

.screenshot-item:first-child:not(:only-child) {
    transform: translateY(20px);
}

.screenshot-item:last-child:not(:only-child) {
    transform: translateY(20px);
}

.screenshot-item:first-child:not(:only-child):hover,
.screenshot-item:last-child:not(:only-child):hover {
    opacity: 1;
    transform: translateY(10px);
}

/* When there are 3 screenshots, middle one is featured */
.screenshots-gallery .screenshot-item:nth-child(2):nth-last-child(2) {
    z-index: 2;
}

/* Legacy placeholder support */
.screenshots-placeholder {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 24px;
    padding: 40px 0;
}

.screenshot-phone {
    transition: transform 0.3s ease;
}

.screenshot-phone:hover {
    transform: translateY(-10px);
}

.screenshot-phone .phone-frame {
    width: 220px;
    height: 450px;
    background: #1a1a1a;
    border-radius: 36px;
    padding: 10px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.screenshot-phone.featured .phone-frame {
    width: 260px;
    height: 530px;
}

.screenshot-phone .phone-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-primary) 100%);
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================
   CTA SECTION
   ============================================ */
.app-cta {
    padding: 80px 24px;
}

.cta-card {
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-secondary) 100%);
    border-radius: 32px;
    padding: 80px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-content h2 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    color: white;
    margin-bottom: 16px;
}

.cta-content p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 32px;
}

.cta-content .app-store-btn {
    background: white;
    color: #000;
    border-color: white;
}

.cta-content .app-store-btn:hover {
    background: #f0f0f0;
}

/* ============================================
   LEGAL SECTION
   ============================================ */
.app-legal {
    padding: 100px 24px;
    background: var(--bg-secondary);
}

.legal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
}

.legal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
}

.legal-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.legal-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--app-primary);
}

.legal-card h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.legal-content h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 24px 0 12px;
}

.legal-content h4:first-child {
    margin-top: 0;
}

.legal-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 12px;
}

.legal-content a {
    color: var(--app-primary);
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-content strong {
    color: var(--text-primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .app-hero {
        padding: 120px 20px 60px;
        min-height: auto;
    }

    .app-hero-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .app-hero-icon {
        width: 100px;
        height: 100px;
        min-width: 100px;
        min-height: 100px;
        max-width: 100px;
        max-height: 100px;
    }

    .app-badge-row {
        justify-content: center;
    }

    .app-hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .app-hero-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 24px;
    }

    .hero-stat {
        align-items: center;
    }

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

    .screenshots-gallery {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 40px 20px;
        gap: 16px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .screenshots-gallery::-webkit-scrollbar {
        display: none;
    }

    .screenshot-item .phone-frame {
        width: 180px;
        height: 370px;
    }

    .screenshot-item.featured .phone-frame {
        width: 200px;
        height: 410px;
    }

    .screenshot-item:first-child:not(:only-child),
    .screenshot-item:last-child:not(:only-child) {
        transform: translateY(0);
        opacity: 1;
    }

    .screenshots-placeholder {
        flex-direction: column;
        align-items: center;
    }

    .screenshot-phone .phone-frame {
        width: 200px;
        height: 400px;
    }

    .screenshot-phone.featured .phone-frame {
        width: 240px;
        height: 480px;
    }

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

    .legal-card {
        padding: 24px;
    }

    .cta-card {
        padding: 60px 24px;
    }
}

@media (max-width: 480px) {
    .app-hero-title {
        font-size: 36px;
    }

    .app-hero-stats {
        gap: 16px;
    }

    .hero-stat-value {
        font-size: 22px;
    }
}
