/* General Styles */
:root {
    --primary-color: #0071e3;
    --background-light: #ffffff;
    --text-light: #1d1d1f;
    --card-bg-light: #f5f5f7;
    --background-dark: #1d1d1f;
    --text-dark: #f5f5f7;
    --card-bg-dark: #2c2c2e;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode styles */
[data-bs-theme="dark"] {
    --bs-body-bg: #121212;
    --bs-body-color: #e9ecef;
    --bs-card-bg: #2c2c2e;
    --bs-card-border-color: #2c2c2e;
}

[data-bs-theme="dark"] .bg-light {
    background-color: #1c1c1e !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #f8f9fa !important;
}

[data-bs-theme="dark"] .border-bottom, 
[data-bs-theme="dark"] .border-top {
    border-color: #2c2c2e !important;
}

[data-bs-theme="dark"] .navbar-light {
    background-color: #1c1c1e !important;
}

[data-bs-theme="dark"] .navbar-light .navbar-brand,
[data-bs-theme="dark"] .navbar-light .nav-link {
    color: #e9ecef;
}

[data-bs-theme="dark"] .card-title {
    color: var(--text-dark);
    padding: 10px 0px;
}


/* Rating Stars */
.rating {
    display: inline-flex;
    align-items: center;
}

/* View Toggle Styles */
.list-view .app-image {
    height: 100px !important;
    width: 100px !important;
    object-fit: cover;
}

.list-view .card {
    flex-direction: row;
}

.list-view .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* App Screenshots Slider */
.app-banner {
    background-size: cover;
    background-position: center;
}

/* Filter Tags */
.filter-tag {
    background-color: var(--bs-light);
    border-radius: 1rem;
    padding: 0.25rem 0.75rem;
    margin-right: 0.5rem;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tag:hover {
    background-color: var(--bs-primary);
    color: white;
}

.filter-tag .close {
    margin-left: 0.5rem;
    font-size: 0.8rem;
}

/* Loading Animation */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Pagination Styles */
.page-link {
    color: var(--bs-primary);
    border-radius: 0.25rem;
    margin: 0 0.25rem;
}

.page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Search Input */
.search-highlight {
    background-color: yellow;
    color: black;
    padding: 0 2px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .card-title {
        font-size: 1rem;
    }
    
    .list-view .card {
        flex-direction: column;
    }
    
    .list-view .app-image {
        width: 100% !important;
    }
}

/* Game Card */

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.game-card {
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.game-icon {
    border-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 72px;
    height: 72px;
    border-radius: 16px;
    margin-top: -36px;
    border: 3px solid;
}

.game-title {
    font-weight: 600;
    font-size: 1.2rem;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.game-developer {
    font-size: 0.9rem;
    opacity: 0.8;
}

.game-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.game-card:hover, .list-game:hover {
    transform: translateY(-5px);
    cursor: pointer;
}

.card {
    background-color: var(--card-bg-light);
}

.card-title {
    color: var(--text-light);
    padding: 10px 0px;
}

a:link {
  text-decoration: none !important;
}

.list-view .game-card-image {
    display: none;
}


.list-view .game-icon {
    margin-top: 0px;
}

.list-view .game-developer {
    margin-bottom: 0.5rem;
}

/* Updated List View Styles */
.list-view .p-3 {
    display: flex;
    align-items: center;
}

.list-view .game-icon {
    margin-top: 0;
    flex-shrink: 0;
}

.list-view .game-info {
    float: right;
    margin-left: 10px;
    flex-grow: 1;
    width: calc(100% - 88px); /* 72px icon + 16px margin */
}

.list-view .game-title {
    max-width: 100%;
    margin-top: 0px;
}


/* Category Bar Styles */
.categories-scroll-container {
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    -ms-overflow-style: none;
}

.categories-scroll-container::-webkit-scrollbar {
    height: 5px;
}

.categories-scroll-container::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 10px;
}

.categories-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 5px 0;
}

.category-pill {
    padding: 8px 16px;
    border-radius: 10px;
    background-color: #f0f0f0;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.category-pill:hover {
    background-color: #e0e0e0;
}

.category-pill.active {
    background-color: var(--primary-color);
    color: white;
}

[data-bs-theme="dark"] .category-pill {
    background-color: #2c2c2e;
}

[data-bs-theme="dark"] .category-pill:hover {
    background-color: #3c3c3e;
}


/* App Detail Page Specific Styles */
.rounded-4 {
    border-radius: 12px;
}

/* Screenshot gallery */
.screenshots-scroll {
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    -ms-overflow-style: none;
}

.screenshots-scroll::-webkit-scrollbar {
    height: 6px;
}

.screenshots-scroll::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 10px;
}

.screenshot-item {
    flex: 0 0 auto;
    width: 240px;
}

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

/* App description with limited height */
.app-description {
    padding-right: 10px;
}

/* Rating Stars */
.rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.rating-stars {
    color: #ff9500;
    font-size: 20px;
}

.rating-count {
    color: #6c757d;
    font-size: 14px;
}

/* Card styling */
.card {
    transition: all 0.3s ease;
    border-radius: 16px;
}

/* Dark mode adjustments */
[data-bs-theme="dark"] .card {
    background-color: var(--card-bg-dark);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .bg-light {
    background-color: #2c2c2e !important;
}

[data-bs-theme="dark"] .text-dark {
    color: #f5f5f7 !important;
}

[data-bs-theme="dark"] .border-bottom {
    border-color: #2c2c2e !important;
}

/* Info items */
.info-item {
    padding: 10px 0;
}

/* What's New section */
.release-notes {
    white-space: pre-line;
}

/* Responsive adjustments */
/* Responsive adjustments continued */
@media (max-width: 768px) {
    .screenshot-item img {
        height: 380px;
    }
    
    h1.fs-2 {
        font-size: 1.5rem !important;
    }
}

/* App banner styles */
.app-banner {
    height: 300px;
    background-size: cover;
    background-position: center;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    position: relative;
}

.app-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.app-banner-content {
    position: relative;
    z-index: 2;
}

/* Button styling */
.btn-primary {
    background-color: #0071e3;
    border-color: #0071e3;
    /*border-radius: 20px;*/
    padding: 8px 16px;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: #0062c1;
    border-color: #0062c1;
}

/* Badge styling */
.badge {
    padding: 12px !important;
    border-radius: 10px;
}

/* App card transitions */
.card {
    /*transition: transform 0.2s ease, box-shadow 0.2s ease;*/
}

.card:hover {
    /*transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;*/
}

/* App store aesthetic */
.shadow-sm {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

/* Rating stars custom styling */
.rating-stars i {
    margin-right: 2px;
}

.rating-stars .half-star {
    position: relative;
    display: inline-block;
}

.rating-stars .half-star::before {
    content: '\F586'; /* Bootstrap icon for half star */
    position: absolute;
    left: 0;
    top: 0;
}

/* App screenshots container */
.screenshots-container {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* App info box styling */
.info-box {
    background-color: #f5f5f7;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

[data-bs-theme="dark"] .info-box {
    background-color: #2c2c2e;
}

/* Developer apps hover effect */
.developer-app {
    transition: all 0.2s ease;
    cursor: pointer;
}

.developer-app:hover {
    transform: scale(1.03);
}

/* Privacy section icons */
.privacy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(52, 199, 89, 0.1);
}

[data-bs-theme="dark"] .privacy-icon {
    background-color: rgba(52, 199, 89, 0.2);
}

/* Section headers */
h2 {
    font-size: 1.4rem;
    font-weight: 600;
}

/* Breadcrumb styling */
.breadcrumb {
    font-size: 0.9rem;
}

.breadcrumb-item a {
    color: #0071e3;
    text-decoration: none;
}

/* Version label */
.version-label {
    background-color: #f5f5f7;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.8rem;
}

[data-bs-theme="dark"] .version-label {
    background-color: #2c2c2e;
}

/* Related apps section */
.related-apps {
    margin-top: 2rem;
}

.related-app-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.related-app-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    margin: 0 auto;
    display: block;
}

/* Apple-like font styling */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Support for Game Center badge */
.game-center-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #f5f5f7;
    border-radius: 8px;
    margin-bottom: 15px;
}

.game-center-badge img {
    width: 32px;
    height: 32px;
}

[data-bs-theme="dark"] .game-center-badge {
    background-color: #2c2c2e;
}

/* App age rating badge */
.age-rating {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #e9ecef;
    font-weight: bold;
    font-size: 0.8rem;
}

[data-bs-theme="dark"] .age-rating {
    background-color: #3c3c3e;
}

/* "Get" button styling similar to App Store */
.get-app-button {
    background-color: #e9ecef;
    color: #0071e3;
    border: none;
    border-radius: 20px;
    padding: 5px 20px;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

.get-app-button:hover {
    background-color: #dee2e6;
}

[data-bs-theme="dark"] .get-app-button {
    background-color: #3c3c3e;
}

/* Copyright text */
.copyright-text {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Fix for images with light backgrounds on dark mode */
[data-bs-theme="dark"] .app-icon {
    border: 1px solid #3c3c3e;
}

/* Screenshot */
    .screenshots-scroll {
        overflow-x: auto;
        padding-bottom: 10px;
        scrollbar-width: thin;
    }

    .screenshots-scroll::-webkit-scrollbar {
        height: 8px;
    }

    .screenshots-scroll::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }

    .screenshots-scroll::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }

    .screenshots-scroll::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

    .screenshot-item {
        min-width: 200px;
        max-width: 300px;
    }

    .screenshot-item img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    /* Điều chỉnh style cho iPhone và iPad */
    #iphone-screenshots .screenshot-item {
        min-width: 200px;
        max-width: 230px;
    }

    #ipad-screenshots .screenshot-item {
        min-width: 280px;
        max-width: 350px;
    }


/* CSS để căn giữa cụm App Header trên mobile */
@media (max-width: 767px) {
  .card-body .row {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .card-body .col-md-2 {
    margin-bottom: 1.5rem;
  }
  
  .card-body .col-md-10 {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  
  .card-body .d-flex.flex-column.flex-md-row {
    flex-direction: column !important;
    align-items: center !important;
    width: 100%;
  }
  
  .card-body .btn.btn-primary {
    margin-top: 1rem;
  }
  
  .card-body .text-muted {
    text-align: center;
  }
  
  .card-body h1.fs-2 {
    text-align: center;
  }
}


/* CSS cho upcoming games slider */
.upcoming-games-slider {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 0;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
}

.upcoming-game-card {
    min-width: 280px;
    max-width: 280px;
    scroll-snap-align: start;
}

.upcoming-game-card .card {
    height: 100%;
    transition: transform 0.3s;
}

.upcoming-game-card .card:hover {
    transform: translateY(-5px);
}

.release-date {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Style cho scrollbar */
.upcoming-games-slider::-webkit-scrollbar {
    height: 6px;
}

.upcoming-games-slider::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.upcoming-games-slider::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.upcoming-games-slider::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.list-game {
    transition: transform 0.3s, box-shadow 0.3s;
    max-width: 175px;
}

/* ADS */
.ad-container {
    max-width: 100%;
    overflow: hidden;
    margin: 0 auto;
    text-align: center;
}

/* Responsive width for different screen sizes */
@media (min-width: 768px) {
    .ad-container {
        max-width: 728px; /* Common ad size */
    }
}

@media (min-width: 992px) {
    .ad-container {
        max-width: 970px; /* Common ad size */
    }
}

@media (max-width: 767px) {
    .ad-container {
        max-width: 320px; /* Common mobile ad size */
    }
}

/* Add small label for ad disclosure */
.ad-container::before {
    content: "Advertisement";
    display: block;
    text-align: center;
    font-size: 0.7rem;
    color: #999;
    margin-bottom: 5px;
}