/**
 * PK STUDY App Store - Main Public Stylesheet
 * Google Play Store aesthetic + PK STUDY purple brand identity
 * Fully responsive for Mobile, Tablet & PC Desktop
 */

:root {
    --primary-gradient: linear-gradient(135deg, #37137f 0%, #5d1bb9 50%, #7d26d8 100%);
    --primary-color: #6d20d6;
    --primary-dark: #260d59;
    --primary-light: #f3ebfc;
    --accent-green: #01875f;
    --accent-green-hover: #016e4d;
    --accent-gold: #f59e0b;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 50px;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
    --bottom-nav-height: 64px;
}

[data-theme="dark"] {
    --bg-page: #0d0f17;
    --bg-card: #171b26;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #272f45;
    --primary-light: #281745;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--bottom-nav-height);
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Container responsive adjustments */
.main-wrapper {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ==========================================================
   1. TOP HEADER & NAVIGATION (Matches Images 1 & 4)
   ========================================================== */
.pk-header {
    background: var(--primary-gradient);
    color: #ffffff;
    padding: 16px 0 20px;
    box-shadow: 0 4px 20px rgba(45, 12, 100, 0.25);
    position: relative;
    z-index: 1000;
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
}

.brand-logo-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2.5px solid #f59e0b;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.brand-logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-info {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.2;
    color: #ffffff;
}

.brand-tagline {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    transition: background 0.2s;
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.notif-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    border: 1.5px solid #ffffff;
}

/* Search Bar (Matches Images 1 & 4) */
.search-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.search-pill {
    background: #ffffff;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    padding: 6px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.search-pill:focus-within {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    border-color: #f59e0b;
}

.search-pill .search-icon {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-right: 12px;
}

.search-pill input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
    background: transparent;
    color: #1e293b;
}

.search-pill input::placeholder {
    color: #94a3b8;
}

.search-pill .mic-icon {
    color: var(--primary-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
}

.search-pill .mic-icon:hover {
    background: rgba(109, 32, 214, 0.1);
}

/* AJAX Search Live Suggestions Dropdown */
.search-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    max-height: 380px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.search-suggestion-item:last-child {
    border-bottom: none;
}

.search-suggestion-item:hover {
    background: var(--primary-light);
}

.search-suggestion-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

/* ==========================================================
   2. PROMOTIONAL BANNER SLIDER (Matches Images 1 & 4)
   ========================================================== */
.banner-slider-section {
    padding: 20px 0 10px;
}

.banner-carousel {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.banner-item {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: none;
    position: relative;
}

.banner-item.active {
    display: block;
}

.banner-img {
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: cover;
    display: block;
}

.banner-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
}

.banner-dot.active {
    width: 24px;
    border-radius: 10px;
    background: var(--primary-color);
}

/* ==========================================================
   3. CATEGORY ICONS GRID (Matches Image 4 & Image 1)
   ========================================================== */
.categories-section {
    padding: 18px 0 14px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px 10px;
}

@media (min-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 16px;
    }
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s ease;
}

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

.category-icon-wrapper {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.6rem;
    margin-bottom: 8px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.2s, transform 0.2s;
}

.category-card:hover .category-icon-wrapper {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.category-title {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2px;
}

.category-subtitle {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

/* ==========================================================
   4. APP SECTIONS & CARDS (Matches Image 4 & Image 1)
   ========================================================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0 14px;
    padding: 0 4px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-more-link {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s;
}

.section-more-link:hover {
    gap: 7px;
    color: var(--primary-dark);
}

/* App List View (Mobile matching Image 4) */
.apps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-list-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.app-list-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(109, 32, 214, 0.3);
}

.app-item-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.app-item-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.app-item-details {
    flex: 1;
    min-width: 0;
}

.app-item-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-item-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-item-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rating-star {
    color: #f59e0b;
    font-weight: 700;
}

/* Install Pill Button (Vibrant Green matching Google Play Store) */
.btn-install-pill {
    background: var(--accent-green);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.88rem;
    border-radius: var(--radius-full);
    padding: 7px 18px;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 3px 8px rgba(1, 135, 95, 0.3);
}

.btn-install-pill:hover {
    background: var(--accent-green-hover);
    color: #ffffff;
    transform: scale(1.03);
    box-shadow: 0 5px 12px rgba(1, 135, 95, 0.4);
}

/* Download Pill Button (For apps not on Play Store) */
.btn-install-pill.btn-download-pill {
    background: #0284c7;
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.3);
}

.btn-install-pill.btn-download-pill:hover {
    background: #0369a1;
    box-shadow: 0 5px 12px rgba(2, 132, 199, 0.4);
}

/* Desktop App Grid (Responsive 2 to 4 columns on larger screens) */
@media (min-width: 768px) {
    .apps-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
}
@media (min-width: 992px) {
    .apps-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* Horizontal Cards Carousel (Matching Desktop Google Play Store) */
.horizontal-app-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: thin;
}

.app-grid-card {
    min-width: 170px;
    max-width: 170px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.app-grid-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.app-grid-card .app-grid-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    object-fit: cover;
    margin: 0 auto 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.app-grid-card .app-grid-title {
    font-size: 0.92rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-grid-card .app-grid-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-grid-card .app-grid-meta {
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.app-grid-card .btn-install-pill {
    width: 100%;
}

/* ==========================================================
   5. APP DETAILS PAGE (Matches Image 2)
   ========================================================== */
.app-detail-header-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.detail-app-top {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.detail-app-logo {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.detail-app-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 4px;
}

.detail-app-developer {
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 8px;
}

.badge-pill-soft {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.badge-verified {
    background: #e6f4ea;
    color: #137333;
}

.badge-category {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* Stat 4/5-Column Bar (Matches Image 2) */
.detail-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 16px 0;
    margin: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.stat-metric-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 8px;
    flex: 1;
}

.stat-metric-col:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.stat-metric-val {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-metric-lbl {
    font-size: 0.74rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Detail Action Buttons (Matches Image 2) */
.detail-actions-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn-primary-install {
    flex: 1;
    min-width: 200px;
    background: var(--accent-green);
    color: #ffffff;
    font-weight: 800;
    font-size: 1.05rem;
    border-radius: var(--radius-full);
    padding: 14px 24px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: none;
    box-shadow: 0 6px 16px rgba(1, 135, 95, 0.35);
    transition: all 0.2s;
}

.btn-primary-install:hover {
    background: var(--accent-green-hover);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(1, 135, 95, 0.45);
}

.btn-secondary-open {
    flex: 1;
    min-width: 200px;
    background: #ffffff;
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.05rem;
    border-radius: var(--radius-full);
    padding: 13px 24px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px solid var(--primary-color);
    transition: all 0.2s;
}

.btn-secondary-open:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* Screenshots Carousel (Matches Image 2) */
.screenshots-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 10px 0 16px;
    scrollbar-width: thin;
}

.screenshot-preview-item {
    border-radius: 18px;
    overflow: hidden;
    height: 380px;
    width: auto;
    min-width: 210px;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color);
}

.screenshot-preview-item img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}

/* External Link Cards (Play Store & Web Version - Matches Image 2) */
.link-box-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.link-box-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.link-box-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.link-box-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

/* Tags Pills */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag-pill {
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all 0.2s;
}

.tag-pill:hover {
    background: var(--primary-color);
    color: #ffffff;
}

/* ==========================================================
   6. BOTTOM NAVIGATION BAR (Matches Images 1 & 4)
   ========================================================== */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
    height: var(--bottom-nav-height);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1040;
    padding: 0 8px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 12px;
    transition: all 0.2s ease;
    flex: 1;
}

.bottom-nav-item i {
    font-size: 1.35rem;
    margin-bottom: 2px;
}

.bottom-nav-item.active {
    color: var(--primary-color);
}

.bottom-nav-item:hover {
    color: var(--primary-color);
}

/* Hide on desktop if wide or adapt */
@media (min-width: 992px) {
    body {
        padding-bottom: 0;
    }
    .bottom-nav-bar {
        display: none;
    }
}

/* Footer Section for Desktop */
.pk-footer {
    background: #0f0a28;
    color: #cbd5e1;
    padding: 40px 0 25px;
    margin-top: 40px;
    font-size: 0.9rem;
}

.pk-footer a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.pk-footer a:hover {
    color: #ffffff;
}
