/*
 * PSVitaAlive Store
 * Application detail page
 */


/* ========================================
   Page
======================================== */

.app-page {
    padding: 28px 0 90px;
}


.app-detail {
    max-width: var(--container-width);

    margin: 0 auto;
}


/* ========================================
   Back
======================================== */

.app-back {
    margin-bottom: 18px;
}


.app-back a {
    display: inline-flex;

    align-items: center;

    min-height: 38px;

    padding: 8px 13px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: 7px;

    color: #a0a0a0;

    font-size: 0.8rem;

    font-weight: 800;

    text-decoration: none;

    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}


.app-back a:hover {
    color: var(--accent);

    border-color: var(--accent);

    background: var(--surface-hover);

    transform: translateX(2px);
}


/* ========================================
   Loading / Error
======================================== */

.app-state {
    max-width: var(--container-width);

    margin: 0 auto;

    padding: 90px 20px;

    text-align: center;
}


.app-state-error h1 {
    margin-bottom: 12px;

    color: #ffffff;
}


.app-state-error p {
    color: #a0a0a0;
}


.app-state-error a {
    display: inline-block;

    margin-top: 20px;

    color: var(--accent);

    font-weight: 800;

    text-decoration: none;
}


.app-state-error a:hover {
    text-decoration: underline;
}


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

.app-hero {
    position: relative;

    display: grid;

    grid-template-columns:
        230px minmax(0, 1fr);

    gap: 34px;

    padding: 34px;

    background:
        linear-gradient(
            135deg,
            rgba(55, 55, 55, 0.96),
            rgba(38, 38, 38, 0.96)
        );

    border: 1px solid var(--border);

    border-radius: var(--radius);

    overflow: hidden;
}


.app-hero::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;
    right: 0;

    height: 3px;

    background: var(--accent);

    box-shadow:
        0 0 18px rgba(
            59,
            255,
            0,
            0.25
        );
}


/* ========================================
   Icon
======================================== */

.app-hero-icon {
    width: 230px;
    height: 230px;

    overflow: hidden;

    background: #000000;

    border: 1px solid #6e6e6e;

    border-radius: 18px;

    box-shadow:
        0 12px 35px rgba(
            0,
            0,
            0,
            0.35
        );
}


.app-hero-icon img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}


/* ========================================
   Hero information
======================================== */

.app-hero-info {
    min-width: 0;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: flex-start;
}


.app-hero-info h1 {
    margin: 12px 0 8px;

    color: #ffffff;

    font-size: clamp(
        2.5rem,
        5vw,
        4.4rem
    );

    font-weight: 900;

    line-height: 0.98;

    letter-spacing: -0.055em;

    overflow-wrap: anywhere;
}


.app-version {
    margin-bottom: 18px;

    color: #ffffff;

    font-size: 0.9rem;

    font-weight: 800;
}


/* ========================================
   Status
======================================== */

.status-badge {
    display: inline-flex;

    align-items: center;

    min-height: 28px;

    padding: 5px 10px;

    background: rgba(
        59,
        255,
        0,
        0.09
    );

    border: 1px solid rgba(
        59,
        255,
        0,
        0.28
    );

    border-radius: 999px;

    color: var(--accent);

    font-size: 0.72rem;

    font-weight: 900;

    text-transform: uppercase;

    letter-spacing: 0.06em;
}


/* ========================================
   Authors / Category
======================================== */

.app-authors,
.app-category {
    line-height: 1.9;

    color: #ffffff;

    font-size: 0.9rem;

    font-weight: 700;
}


.app-meta-label {
    margin-right: 6px;

    color: #a0a0a0;

    font-weight: 800;
}


.app-author-link,
.app-category-link {
    color: var(--accent);

    font-weight: 900;

    text-decoration: none;
}


.app-author-link:hover,
.app-category-link:hover {
    text-decoration: underline;
}


.app-subcategories {
    color: #ffffff;

    font-weight: 700;
}


/* ========================================
   Sections
======================================== */

.app-section {
    margin-top: 24px;

    padding: 30px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);
}


.app-section h2 {
    position: relative;

    margin: 0 0 22px;

    padding-left: 14px;

    color: #ffffff;

    font-size: 1.35rem;

    font-weight: 900;
}


.app-section h2::before {
    content: "";

    position: absolute;

    left: 0;
    top: 3px;
    bottom: 3px;

    width: 3px;

    background: var(--accent);

    border-radius: 2px;
}


/* ========================================
   Description
======================================== */

.app-description {
    margin: 0 0 22px;

    color: #ffffff;

    font-size: 1.05rem;

    font-weight: 600;

    line-height: 1.75;
}


.app-long-description {
    color: #d0d0d0;

    line-height: 1.85;

    white-space: pre-line;
}


/* ========================================
   Screenshots
======================================== */

.app-screenshots {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(240px, 1fr)
        );

    gap: 14px;
}


.app-screenshot {
    display: block;

    overflow: hidden;

    aspect-ratio: 16 / 9;

    background: #000000;

    border: 1px solid var(--border);

    border-radius: 10px;
}


.app-screenshot img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    transition:
        transform 0.25s ease;
}


.app-screenshot:hover {
    border-color: var(--accent);
}


.app-screenshot:hover img {
    transform: scale(1.035);
}


/* ========================================
   Information
======================================== */

.app-information {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 12px;

    margin: 0;
}


.app-information div {
    min-width: 0;

    padding: 17px;

    background: #6e6e6e;

    border: 1px solid #7c7c7c;

    border-radius: 9px;
}


.app-information dt {
    margin-bottom: 8px;

    color: var(--accent);

    font-size: 0.72rem;

    font-weight: 900;

    text-transform: uppercase;

    letter-spacing: 0.07em;
}


.app-information dd {
    margin: 0;

    color: #ffffff;

    font-size: 0.96rem;

    font-weight: 800;

    line-height: 1.55;

    overflow-wrap: anywhere;
}


/* ========================================
   Links
======================================== */

.app-links {
    display: flex;

    flex-wrap: wrap;

    gap: 10px;
}


.app-link-button {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 44px;

    padding: 10px 17px;

    background: #373737;

    border: 1px solid #6e6e6e;

    border-radius: 8px;

    color: #ffffff;

    font-size: 0.82rem;

    font-weight: 900;

    text-decoration: none;

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}


.app-link-button:hover {
    transform: translateY(-2px);

    background: #6e6e6e;

    border-color: var(--accent);

    color: var(--accent);
}


/* ========================================
   Recommended
======================================== */

.app-link-button.recommended {
    position: relative;

    min-height: 50px;

    padding: 12px 23px;

    background: var(--accent);

    border: 2px solid var(--accent);

    color: #000000;

    font-size: 0.88rem;

    font-weight: 950;

    box-shadow:
        0 0 0 1px rgba(
            59,
            255,
            0,
            0.18
        ),
        0 0 20px rgba(
            59,
            255,
            0,
            0.22
        );
}


.app-link-button.recommended::before {
    content: "★";

    margin-right: 8px;

    font-size: 0.9rem;
}


.app-link-button.recommended:hover {
    background: #ffffff;

    border-color: #ffffff;

    color: #000000;

    box-shadow:
        0 0 0 2px rgba(
            59,
            255,
            0,
            0.28
        ),
        0 0 28px rgba(
            59,
            255,
            0,
            0.35
        );

    transform: translateY(-3px);
}


/* ========================================
   Mobile
======================================== */

@media (max-width: 800px) {

    .app-hero {
        grid-template-columns: 1fr;

        padding: 25px;

        gap: 24px;
    }


    .app-hero-icon {
        width: 190px;
        height: 190px;

        margin: 0 auto;
    }


    .app-hero-info {
        align-items: center;

        text-align: center;
    }


    .app-section {
        padding: 23px;
    }

}


@media (max-width: 600px) {

    .app-page {
        padding-top: 20px;
    }


    .app-information {
        grid-template-columns: 1fr;
    }


    .app-screenshots {
        grid-template-columns: 1fr;
    }


    .app-links {
        flex-direction: column;
    }


    .app-link-button {
        width: 100%;
    }


    .app-hero-info h1 {
        font-size: 2.5rem;
    }

}

/* ========================================
   Refined application detail — aligned with
   the responsive catalog card language
======================================== */
.app-detail {
    width: min(calc(100% - 40px), var(--container-width));
}

.app-back { margin-bottom: 16px; }
.app-back a {
    min-height: 40px;
    color: #d4d4d4;
    background: #262626;
}
.app-back a:hover { background: #373737; }

.app-hero {
    grid-template-columns: 156px minmax(0, 1fr);
    align-items: center;
    gap: 26px;
    padding: 26px;
    background: linear-gradient(135deg, #333333, #202020);
}
.app-hero-icon {
    width: 156px;
    height: 156px;
    border-radius: 16px;
    background: #171717;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .24);
}
.app-hero-info { align-items: flex-start; text-align: left; }
.app-hero-info h1 {
    max-width: 100%;
    margin: 10px 0 10px;
    font-size: clamp(2rem, 3.6vw, 3.5rem);
    line-height: 1.08;
    letter-spacing: -.035em;
}
.app-version {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    margin: 0 0 10px;
    padding: 6px 11px;
    border: 1px solid #555;
    border-radius: 7px;
    background: #202020;
    color: #e0e0e0;
    font-size: .82rem;
    line-height: 1.3;
}
.app-authors, .app-category {
    max-width: 100%;
    color: #cfcfcf;
    font-size: .86rem;
    line-height: 1.6;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.app-meta-label { color: #b3b3b3; }
.app-author-link, .app-category-link { color: var(--accent); }

.app-overview {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr);
    align-items: stretch;
    gap: 18px;
    margin-top: 18px;
}
.app-overview > .app-section { min-width: 0; margin: 0; }
.app-section {
    margin-top: 18px;
    padding: 24px;
    background: #2b2b2b;
    border-color: #535353;
}
.app-section h2 {
    margin-bottom: 18px;
    font-size: 1.18rem;
    letter-spacing: -.015em;
}
.app-description {
    margin: 0 0 14px;
    font-size: 1rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.app-long-description {
    color: #c9c9c9;
    font-size: .9rem;
    line-height: 1.7;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
.app-screenshots {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 12px;
}
.app-screenshot { background: #151515; }
.app-screenshot img { object-fit: contain; }
.app-information { grid-template-columns: 1fr; gap: 9px; }
.app-information > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 12px 14px;
    background: #1f1f1f;
    border: 1px solid #454545;
    border-radius: 8px;
}
.app-information dt {
    flex: 0 0 auto;
    margin: 0;
    color: #a9a9a9;
    font-size: .7rem;
    line-height: 1.5;
}
.app-information dd {
    min-width: 0;
    text-align: right;
    color: #f1f1f1;
    font-size: .85rem;
    font-weight: 700;
    line-height: 1.5;
}
@media (max-width: 900px) {
    .app-overview { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .app-detail { width: calc(100% - 28px); }
    .app-page { padding-block: 20px 64px; }
    .app-hero {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 14px;
        align-items: center;
        padding: 16px;
    }
    .app-hero-icon { width: 92px; height: 92px; margin: 0; border-radius: 12px; }
    .app-hero-info { align-items: flex-start; text-align: left; }
    .app-hero-info h1 {
        margin: 7px 0;
        font-size: clamp(1.5rem, 6vw, 2.25rem);
        line-height: 1.1;
    }
    .app-hero-info .status-badge { font-size: .62rem; min-height: 24px; padding: 4px 8px; }
    .app-version { min-height: 27px; padding: 4px 8px; margin-bottom: 7px; font-size: .74rem; }
    .app-authors, .app-category { font-size: .79rem; line-height: 1.5; }
    .app-overview { gap: 14px; margin-top: 14px; }
    .app-section { margin-top: 14px; padding: 18px; }
    .app-screenshots { grid-template-columns: 1fr; }
    .app-information > div { padding: 10px 12px; }
}
@media (max-width: 360px) {
    .app-hero { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 14px; }
    .app-hero-icon { width: 76px; height: 76px; }
    .app-hero-info h1 { font-size: 1.4rem; }
}
