/*
 * =============================================================================
 * ARTISAN MEDIA - APP PAGES STYLES ONLY (Phase 2)
 * =============================================================================
 * Use this file ONLY for app product pages (iOS/macOS apps).
 * Main site (index, contact, etc.) does NOT use this file.
 * Colours and typography match the main Artisan Media website.
 * =============================================================================
 */

/* Base: only apply when body has class app-page (avoids affecting main site) */
body.app-page,
.app-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

html {
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
}

.app-page * {
    box-sizing: border-box;
}

/* Site colours (match main site) */
.app-page .app-accent { color: #72B026; }
.app-page .app-bg-accent { background: linear-gradient(135deg, #72B026 0%, #2db700 100%); }
.app-page .app-text-muted { color: #555; }
.app-page .app-text-light { color: #777; }

/* ---- App top bar (back to main site) ---- */
.app-page .app-topbar {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}

.app-page .app-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

.app-page .app-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.app-page .app-back-link:hover {
    color: #72B026;
}

.app-page .app-nav-bar {
    background: #fff;
    border-bottom: 1px solid #eee;
    padding: 12px 0;
    font-size: 0.9rem;
    text-align: center;
}

.app-page .app-nav-bar a {
    color: #72B026;
    text-decoration: none;
}

.app-page .app-nav-bar a:hover {
    text-decoration: underline;
}

/* ---- App hero (icon, name, subtitle) ---- */
.app-page .app-hero {
    text-align: center;
    padding: 40px 20px 50px;
    background: linear-gradient(135deg, #72B026 0%, #2db700 100%);
    color: #fff;
}

.app-page .app-hero-icon {
    width: 120px;
    height: 120px;
    border-radius: 26px;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    object-fit: cover;
}

.app-page .app-hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.2;
}

.app-page .app-hero-subtitle {
    font-size: 1.15rem;
    opacity: 0.95;
    margin: 0;
    font-weight: 500;
}

/* ---- App meta (categories, age, pricing) ---- */
.app-page .app-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    justify-content: center;
    margin-top: 20px;
}

.app-page .app-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.2);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
}

.app-page .app-meta-item i {
    font-size: 0.85em;
}

/* ---- Main content container ---- */
.app-page .app-main {
    padding: 50px 20px 60px;
}

.app-page .app-section {
    max-width: 800px;
    margin: 0 auto 48px;
}

.app-page .app-section:last-of-type {
    margin-bottom: 0;
}

.app-page .app-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #72B026;
    display: inline-block;
}

.app-page .app-section-title.app-accent {
    border-bottom-color: #72B026;
}

/* ---- Screenshots (slideshow: one visible at a time) ---- */
.app-page .app-screenshots {
    margin-bottom: 48px;
}

/* Force no background on entire screenshot slideshow (main view only) */
.app-page .app-screenshots .app-screenshots-slideshow,
.app-page .app-screenshots .app-screenshots-slideshow .app-slideshow-viewport,
.app-page .app-screenshots .app-screenshots-slideshow .app-slideshow-track,
.app-page .app-screenshots .app-screenshots-slideshow .app-slide,
.app-page .app-screenshots .app-screenshots-slideshow .app-slide img,
.app-page .app-screenshots .app-screenshots-slideshow .app-slideshow-viewport::before,
.app-page .app-screenshots .app-screenshots-slideshow .app-slideshow-viewport::after,
.app-page .app-screenshots .app-screenshots-slideshow .app-slideshow-track::before,
.app-page .app-screenshots .app-screenshots-slideshow .app-slideshow-track::after {
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.app-page .app-screenshots-slideshow {
    position: relative;
    max-width: 320px;
    margin: 24px auto 0;
    overflow: visible;
}

.app-page .app-slideshow-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 19.5;
    max-height: 520px;
}

.app-page .app-slideshow-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.app-page .app-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.app-page .app-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.app-page .app-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    /* drop-shadow follows the visible image shape, adapting to each screenshot's size/ratio */
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.15)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Slideshow prev/next buttons */
.app-page .app-slideshow-prev,
.app-page .app-slideshow-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    transition: background 0.2s ease, color 0.2s ease;
}

.app-page .app-slideshow-prev:hover,
.app-page .app-slideshow-next:hover {
    background: #72B026;
    color: #fff;
}

.app-page .app-slideshow-prev {
    left: 12px;
}

.app-page .app-slideshow-next {
    right: 12px;
}

.app-page .app-slideshow-prev i,
.app-page .app-slideshow-next i {
    font-size: 1.1rem;
}

/* Slideshow dots */
.app-page .app-slideshow-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.app-page .app-slideshow-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: #ddd;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.app-page .app-slideshow-dot:hover {
    background: #bbb;
}

.app-page .app-slideshow-dot.is-active {
    background: #72B026;
    transform: scale(1.2);
}

/* Fullscreen slideshow overlay */
.app-page .app-slideshow-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.app-page .app-slideshow-fullscreen.is-open {
    opacity: 1;
    visibility: visible;
}

body.app-fullscreen-active {
    overflow: hidden;
}

.app-page .app-fullscreen-close {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 10001;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease;
}

.app-page .app-fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.app-page .app-fullscreen-img-wrap {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-page .app-fullscreen-img {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.app-page .app-fullscreen-prev,
.app-page .app-fullscreen-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10001;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.app-page .app-fullscreen-prev:hover,
.app-page .app-fullscreen-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.app-page .app-fullscreen-prev {
    left: 20px;
}

.app-page .app-fullscreen-next {
    right: 20px;
}

.app-page .app-fullscreen-prev i,
.app-page .app-fullscreen-next i {
    font-size: 1.25rem;
}

/* Legacy grid (optional: keep for pages that prefer grid) */
.app-page .app-screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.app-page .app-screenshot-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    background: #f8f9fa;
}

.app-page .app-screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: middle;
}

/* ---- Blurb / description ---- */
.app-page .app-blurb {
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
}

.app-page .app-blurb p {
    margin: 0 0 1em;
}

.app-page .app-blurb p:last-child {
    margin-bottom: 0;
}

.app-page .app-blurb ul {
    margin: 0 0 1em;
    padding-left: 1.25em;
}

.app-page .app-blurb li {
    margin-bottom: 0.35em;
}

.app-page .app-blurb li:last-child {
    margin-bottom: 0;
}

.app-page .app-blurb strong {
    color: #333;
}

/* ---- In-App Purchases (free vs premium breakdown) ---- */
.app-page .app-iap {
    margin-top: 8px;
}

.app-page .app-iap-category {
    margin-bottom: 24px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.app-page .app-iap-category:last-child {
    margin-bottom: 0;
}

.app-page .app-iap-category-title {
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.app-page .app-iap-row {
    padding: 12px 16px 14px;
    border-bottom: 1px solid #f0f0f0;
}

.app-page .app-iap-row:last-child {
    border-bottom: none;
}

.app-page .app-iap-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}

.app-page .app-iap-label--free {
    color: #555;
}

.app-page .app-iap-label--iap {
    color: #72B026;
}

.app-page .app-iap-row ul {
    margin: 0;
    padding-left: 1.2em;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.5;
}

.app-page .app-iap-row li {
    margin-bottom: 0.2em;
}

.app-page .app-iap-row li:last-child {
    margin-bottom: 0;
}

.app-page .app-iap-intro {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 20px;
}

/* ---- Privacy ---- */
.app-page .app-privacy {
    font-size: 0.95rem;
    color: #555;
}

.app-page .app-privacy a {
    color: #72B026;
    text-decoration: none;
}

.app-page .app-privacy a:hover {
    text-decoration: underline;
}

/* ---- App Store links ---- */
.app-page .app-store-links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
}

.app-page .app-store-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: #333;
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.app-page .app-store-link:hover {
    background: #72B026;
    transform: translateY(-2px);
}

.app-page .app-store-link i {
    font-size: 1.5rem;
}

/* ---- Footer ---- */
.app-page .app-footer {
    text-align: center;
    padding: 32px 20px;
    border-top: 1px solid #eee;
    color: #777;
    font-size: 0.9rem;
}

.app-page .app-footer a {
    color: #72B026;
    text-decoration: none;
}

.app-page .app-footer a:hover {
    text-decoration: underline;
}

.app-page .app-footer-copyright {
    margin-top: 8px;
}

/* ---- App Support Form ---- */
.app-page .app-support-form {
    max-width: 560px;
    margin-top: 24px;
}

.app-page .app-support-form .form-group {
    margin-bottom: 20px;
}

.app-page .app-support-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
}

.app-page .app-support-form input[type="text"],
.app-page .app-support-form input[type="email"],
.app-page .app-support-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
}

.app-page .app-support-form input:focus,
.app-page .app-support-form textarea:focus {
    outline: none;
    border-color: #72B026;
    box-shadow: 0 0 0 3px rgba(114, 176, 38, 0.15);
}

.app-page .app-support-form textarea {
    min-height: 140px;
    resize: vertical;
}

.app-page .app-support-form .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
    cursor: pointer;
}

.app-page .app-support-form .checkbox-label input[type="checkbox"] {
    margin-top: 4px;
    flex-shrink: 0;
}

.app-page .app-support-form .btn-primary {
    display: inline-block;
    padding: 14px 28px;
    background: #72B026;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.app-page .app-support-form .btn-primary:hover {
    background: #5a8f1f;
    transform: translateY(-1px);
}

.app-page .app-support-form .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.app-page .app-faq-accordion {
    max-width: 640px;
}

.app-page .app-faq-accordion details {
    margin-bottom: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.app-page .app-faq-accordion details[open] {
    border-color: #72B026;
    border-left-width: 4px;
}

.app-page .app-faq-accordion summary {
    padding: 16px 20px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    user-select: none;
}

.app-page .app-faq-accordion summary::-webkit-details-marker,
.app-page .app-faq-accordion summary::marker {
    display: none;
}

.app-page .app-faq-accordion summary::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8rem;
    color: #72B026;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.app-page .app-faq-accordion details[open] summary::after {
    transform: rotate(180deg);
}

.app-page .app-faq-accordion summary:hover {
    background: #f8f9fa;
}

.app-page .app-faq-accordion .app-faq-answer {
    padding: 0 20px 16px;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
}

.app-page .app-faq-accordion .app-faq-answer p {
    margin: 0;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .app-page .app-hero-title {
        font-size: 1.75rem;
    }
    .app-page .app-hero-subtitle {
        font-size: 1rem;
    }
    .app-page .app-hero-icon {
        width: 100px;
        height: 100px;
    }
    .app-page .app-screenshots-slideshow {
        max-width: 280px;
    }
    .app-page .app-slideshow-viewport {
        max-height: 400px;
    }
    .app-page .app-screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .app-page .app-store-links {
        flex-direction: column;
    }
    .app-page .app-store-link {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .app-page .app-screenshots-grid {
        grid-template-columns: 1fr;
    }
}
