/* ========================================
   SECTION: MOBILE APPLICATIONS
   ======================================== */

.apps-section {
    position: relative;
    background: #040712;
    padding: 1.5rem 2rem 0.5rem;
}

.apps-container {
    max-width: 1200px;
    margin: 0 auto;
}

.apps-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.apps-tag {
    display: inline-block;
    color: #00d4ff;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    font-weight: 700;
}

.apps-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.7rem, 3.8vw, 2.8rem);
    margin: 0;
    color: #fff;
}

.apps-subtitle {
    margin: 0.5rem auto 0;
    max-width: 700px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.95rem;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.2rem;
}

.app-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 16px;
    overflow: hidden;
}

.app-media:not(.app-media--slideshow) {
    height: 280px;
    background: #000;
}

.app-media.app-media--slideshow {
    height: auto;
}

.app-media:not(.app-media--slideshow) img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Baghdad carousel: full screenshot visible (contain, no crop) + dots only */
.app-media--slideshow {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 280px;
    padding: 0;
    background: #0a0a0f;
}

.app-carousel__viewport {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 260px;
    overflow: hidden;
}

.app-carousel__slides {
    position: relative;
    width: 100%;
    min-height: 260px;
    height: 100%;
}

.app-carousel__slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.55s ease, visibility 0.55s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.app-carousel__slide.is-active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.app-carousel__slide img {
    width: 100%;
    height: 100%;
    max-height: 320px;
    object-fit: contain;
    object-position: center;
}

.app-media--slideshow-multi .app-carousel__slide--multi {
    padding: 0.5rem;
}

.app-carousel__multi {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.app-carousel__panel {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    overflow: hidden;
    cursor: zoom-in;
}

.app-carousel__panel--single {
    padding: 0.2rem;
}

.app-carousel__slide--multi .app-carousel__panel {
    padding: 0.3rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 255, 0.22);
    background: rgba(7, 14, 26, 0.9);
}

.app-carousel__slide--multi .app-carousel__panel:hover {
    border-color: rgba(0, 212, 255, 0.45);
}

.app-carousel__slide--multi img {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 9px;
    object-fit: cover;
    object-position: top center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.app-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    border: 0;
    padding: 1rem;
    background: rgba(3, 8, 18, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
}

.app-lightbox.is-open {
    display: flex;
}

.app-lightbox__image {
    max-width: min(92vw, 520px);
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    object-fit: contain;
}

.app-lightbox__close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(8, 18, 35, 0.72);
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.app-carousel__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    padding: 0.65rem 0.5rem 0.75rem;
    flex-shrink: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65), transparent);
    position: relative;
    z-index: 2;
}

.app-carousel__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.app-carousel__dot:hover {
    background: rgba(0, 212, 255, 0.6);
}

.app-carousel__dot.is-active {
    background: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.7);
    transform: scale(1.15);
}

.app-content {
    padding: 1rem 1rem 1.1rem;
}

.app-name {
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
}

.app-content__line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 1rem;
    row-gap: 0;
}

.app-content__line .app-details {
    margin: 0;
    min-width: 0;
    grid-column: 1;
}

.app-content__line .app-status,
.app-content__line .app-status--link {
    margin-top: 0;
    white-space: nowrap;
    justify-self: end;
    grid-column: 2;
    grid-row: 1;
    align-self: start;
}

.app-desc {
    margin: 0.5rem 0 0.45rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.88rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    min-height: calc(0.88rem * 1.5 * 3);
}

.app-details {
    margin: 0 0 0.75rem;
}

.app-details__summary {
    cursor: pointer;
    color: #00d4ff;
    font-size: 0.82rem;
    font-weight: 600;
    list-style: none;
    display: inline-flex;
    align-items: center;
}

.app-details__summary-row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.app-icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
    color: inherit;
}

.app-icon--external {
    opacity: 0.9;
}

.app-icon--chevron {
    transition: transform 0.22s ease;
}

.app-details[open] .app-icon--chevron {
    transform: rotate(180deg);
}

.app-details__summary::-webkit-details-marker {
    display: none;
}

.app-details__body {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.82rem;
    line-height: 1.55;
}

.app-details__intro {
    margin: 0 0 0.65rem;
}

.app-details__features-label {
    margin: 0.65rem 0 0.4rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.app-details__list {
    margin: 0;
    padding-left: 1.15rem;
}

.app-details__list li {
    margin-bottom: 0.35rem;
}

.app-details__list li:last-child {
    margin-bottom: 0;
}

.app-status {
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #00d4ff;
    font-weight: 700;
}

a.app-status--link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.15rem;
    text-decoration: none;
    color: #00d4ff;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease, text-shadow 0.2s ease;
}

.app-status--row {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

a.app-status--link:hover {
    color: #5cefff;
    border-bottom-color: rgba(0, 212, 255, 0.55);
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.35);
}

a.app-status--link:focus-visible {
    outline: 2px solid #00d4ff;
    outline-offset: 3px;
}

span.app-status:not(.app-status--link):not(.app-status--row) {
    display: inline-block;
    margin-top: 0.15rem;
}

span.app-status.app-status--row {
    margin-top: 0.15rem;
}

.app-card--placeholder {
    border-style: dashed;
    border-color: rgba(0, 212, 255, 0.25);
}

.app-media--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(170, 0, 255, 0.08));
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .apps-section {
        padding: 0.2rem 1rem 0.3rem;
    }

    .apps-grid {
        grid-template-columns: 1fr;
    }

    .app-media:not(.app-media--slideshow) {
        height: 220px;
    }

    .app-media--slideshow {
        min-height: 220px;
    }

    .app-carousel__viewport,
    .app-carousel__slides {
        min-height: 200px;
    }

    .app-carousel__slide img {
        max-height: 240px;
    }

    .app-media--slideshow-multi .app-carousel__slide--multi {
        padding: 0.4rem;
    }

    .app-carousel__multi {
        gap: 0.35rem;
    }
}
