/* Google Play Style Android Status Pages */

/* Google Play Style App Information Section */
.android-app-section {
    background: #fff;
    min-height: 100vh;
}

/* App Header Section - Enhanced Flexible Layout */
.app-header-section {
    padding: 2rem 0;
    border-bottom: 1px solid #e8eaed;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.app-header-section .d-flex {
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
}

/* Desktop: Enhanced flexible layout */
@media (min-width: 992px) {
    .app-header-section {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .app-header-section .d-flex {
        flex-wrap: nowrap;
        align-items: flex-start;
    }
}

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

/* App Title and Category Row */
.app-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.app-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #202124;
    margin: 0;
    line-height: 1.2;
}

.category-badge {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #dadce0;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Desktop: Enhanced title row layout */
@media (min-width: 992px) {
    .app-title-row {
        gap: 1.25rem;
        /* align-items: baseline; - disabled */
    }
    
    .app-title {
        font-size: 2rem;
    }
    
    .category-badge {
        font-size: 0.8rem;
        padding: 0.375rem 1rem;
    }
}

/* Mobile: Stack if needed */
@media (max-width: 767px) {
    .app-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .app-title {
        font-size: 1.5rem;
    }
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.star-rating {
    color: #fbbc04;
    font-size: 1rem;
}

.rating-count {
    font-size: 0.75rem;
    color: #5f6368;
    margin-top: 0.25rem;
}

/* App Quick Info */
.app-quick-info {
    margin-top: 0.5rem;
}

.quick-info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.875rem;
    align-items: center;
    justify-content: flex-start;
}

/* Desktop: Better spacing for labeled items */
@media (min-width: 992px) {
    .quick-info-row {
        gap: 1.25rem;
        flex-wrap: wrap;
    }
}

.quick-info-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: #5f6368;
    background: #f8f9fa;
    padding: 0.375rem 0.75rem;
    border-radius: 12px;
    border: 1px solid #e8eaed;
    white-space: nowrap;
    min-height: 28px;
}

.quick-info-item i {
    font-size: 0.875rem;
    color: #1a73e8;
    flex-shrink: 0;
}

.quick-info-item span {
    line-height: 1.2;
}

.quick-info-item strong {
    color: #202124;
    font-weight: 500;
}

/* Developer link in quick info */
.quick-info-developer {
    background: #e8f0fe;
    border-color: #1a73e8;
}

.developer-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.developer-link:hover {
    color: #1a73e8;
    text-decoration: none;
}

.developer-link strong {
    color: inherit;
}

/* Desktop: Better spacing for labeled items */
@media (min-width: 992px) {
    .quick-info-item {
        padding: 0.5rem 1rem;
        gap: 0.5rem;
        font-size: 0.8rem;
    }
    
    .quick-info-item i {
        font-size: 1rem;
    }
}

/* Combined info layout for better desktop utilization */
.app-info-combined {
    margin-top: 12px;
}

/* Desktop optimizations */
@media (min-width: 992px) {
    .app-category-rating {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 20px;
    }
    
    .app-info-combined {
        display: flex;
        gap: 40px;
        margin-top: 8px;
    }
    
    .rating-summary {
        flex-shrink: 0;
        border-right: 1px solid #e0e0e0;
        padding-right: 30px;
        min-width: 150px;
    }
    
    .app-quick-info {
        flex: 1;
    }
    
    .quick-info-row {
        gap: 25px;
        flex-wrap: wrap;
    }
    
    .quick-info-item {
        white-space: nowrap;
    }
}

/* Mobile keeps the original stacked layout */
@media (max-width: 991px) {
    .app-info-combined {
        display: block;
    }
    
    .app-quick-info {
        margin-top: 12px;
    }
}

/* Achievement Medals System */
.achievement-medals {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.achievement-medal {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.achievement-medal::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Medal Types */
.medal-billion-downloads {
    background: linear-gradient(135deg, #FFD700 0%, #FFA000 100%);
    border: 1px solid #FF8F00;
}

.medal-million-downloads {
    background: linear-gradient(135deg, #C0C0C0 0%, #8C8C8C 100%);
    border: 1px solid #757575;
}

.medal-high-rating {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    border: 1px solid #1B5E20;
}

.medal-top-rated {
    background: linear-gradient(135deg, #2196F3 0%, #0D47A1 100%);
    border: 1px solid #01579B;
}

.medal-million-reviews {
    background: linear-gradient(135deg, #9C27B0 0%, #4A148C 100%);
    border: 1px solid #311B92;
}

.medal-editors-choice {
    background: linear-gradient(135deg, #FF5722 0%, #BF360C 100%);
    border: 1px solid #DD2C00;
}

/* Medal Icons */
.medal-icon {
    font-size: 0.8rem;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

/* Desktop: Slightly larger medals */
@media (min-width: 992px) {
    .achievement-medals {
        gap: 0.625rem;
        margin-top: 0.75rem;
    }
    
    .achievement-medal {
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
    }
    
    .medal-icon {
        font-size: 0.875rem;
    }
}

/* Mobile: Compact medals */
@media (max-width: 767px) {
    .achievement-medals {
        gap: 0.375rem;
    }
    
    .achievement-medal {
        padding: 0.2rem 0.4rem;
        font-size: 0.65rem;
    }
    
    .medal-icon {
        font-size: 0.7rem;
    }
}

/* Screenshots Gallery */
.screenshots-section {
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e8eaed;
}

.screenshots-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: #202124;
    margin-bottom: 1rem;
}

.screenshots-gallery {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #dadce0 transparent;
}

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

.screenshots-gallery::-webkit-scrollbar-track {
    background: transparent;
}

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

.screenshots-gallery::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}

.screenshot-item {
    flex: 0 0 auto;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    max-width: 200px;
}

.screenshot-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.screenshot-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Description Section */
.description-section {
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e8eaed;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 500;
    color: #202124;
    margin-bottom: 1rem;
}

.app-description {
    color: #5f6368;
    line-height: 1.5;
    font-size: 0.875rem;
}

.read-more-btn {
    background: none;
    border: none;
    color: #1a73e8;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.5rem 0 0 0;
}

.read-more-btn:hover {
    text-decoration: underline;
}

/* Ratings Section */
.ratings-section {
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e8eaed;
}

.ratings-overview {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: start;
}

.overall-rating {
    text-align: center;
    min-width: 120px;
}

.rating-score {
    font-size: 3.5rem;
    font-weight: 300;
    color: #202124;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.rating-stars-large {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-bottom: 0.5rem;
}

.star-large {
    font-size: 1.25rem;
    color: #fbbc04;
}

.rating-count {
    font-size: 0.75rem;
    color: #5f6368;
}

.rating-histogram {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 300px;
}

.rating-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
}

.rating-number {
    color: #5f6368;
    min-width: 8px;
}

.bar-container {
    height: 8px;
    background: #f1f3f4;
    border-radius: 4px;
    overflow: hidden;
    min-width: 0;
}

.bar-fill {
    height: 100%;
    background: #34a853;
    transition: width 0.3s ease;
}

.bar-count {
    color: #5f6368;
    min-width: 30px;
    text-align: right;
}

/* Reviews List */
.reviews-header-info {
    border-bottom: 1px solid #e8eaed;
    padding-bottom: 1rem;
}

.reviews-title {
    font-size: 1.125rem;
    font-weight: 500;
    color: #202124;
}

.reviews-count {
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Desktop: Smart 2-column review layout for better space utilization */
@media (min-width: 992px) {
    .reviews-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem 2rem;
        align-items: start;
    }
    
    /* Ensure review items fit properly in grid */
    .review-item {
        width: 100%;
        max-width: none;
        break-inside: avoid; /* Prevent breaking across columns if using CSS columns fallback */
    }
}

/* Tablet: Enhanced single column with better spacing */
@media (min-width: 768px) and (max-width: 991px) {
    .reviews-list {
        gap: 1.75rem;
    }
    
    .review-item {
        max-width: 100%;
    }
}

.review-item {
    padding: 1rem;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    background: #fafbfc;
    height: fit-content; /* Prevent unnecessary stretching in grid */
    transition: box-shadow 0.2s ease-in-out;
}

.review-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.review-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.reviewer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1a73e8;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    overflow: hidden;
    position: relative;
}

.reviewer-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.reviewer-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a73e8;
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
}

.review-info {
    flex: 1;
}

.reviewer-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #202124;
    margin: 0 0 0.25rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Desktop: Handle long names better in 2-column layout */
@media (min-width: 992px) {
    .reviewer-name {
        font-size: 0.85rem;
        max-width: 180px; /* Prevent very long names from breaking layout */
    }
}

.review-date {
    font-size: 0.75rem;
    color: #5f6368;
}

.review-rating {
    display: flex;
    gap: 2px;
    margin-bottom: 0.75rem;
}

.review-star {
    font-size: 0.875rem;
    color: #fbbc04;
}

.review-text {
    color: #5f6368;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Desktop: Better text handling in 2-column layout */
@media (min-width: 992px) {
    .review-text {
        font-size: 0.85rem;
        line-height: 1.45;
        max-height: 120px; /* Limit very long reviews */
        overflow: hidden;
        position: relative;
    }
    
    /* Add fade effect for long reviews */
    .review-text::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 20px;
        background: linear-gradient(transparent, #fafbfc);
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    /* Show fade effect only when text is cut off */
    .review-item:hover .review-text::after {
        opacity: 1;
    }
}

/* Reviews Pagination */
.reviews-pagination-container {
    border-top: 1px solid #e8eaed;
    padding-top: 1.5rem;
}

.reviews-pagination .pagination {
    margin-bottom: 0;
}

.reviews-pagination .page-link {
    color: #1a73e8;
    border-color: #e8eaed;
    padding: 0.5rem 0.75rem;
}

.reviews-pagination .page-link:hover {
    color: #1557b0;
    background-color: #f8f9fa;
    border-color: #dadce0;
}

.reviews-pagination .page-item.active .page-link {
    background-color: #1a73e8;
    border-color: #1a73e8;
    color: white;
}

.reviews-pagination .page-item.disabled .page-link {
    color: #5f6368;
    background-color: transparent;
    border-color: #e8eaed;
}

/* No Reviews State */
.no-reviews {
    padding: 3rem 1rem;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    background: #fafbfc;
}

/* App Details Grid */
.app-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e8eaed;
}

.detail-card {
    border: 1px solid #e8eaed;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.detail-header {
    background: #f8f9fa;
    padding: 1rem;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-icon {
    color: #5f6368;
    font-size: 1.125rem;
}

.detail-title {
    font-size: 1rem;
    font-weight: 500;
    color: #202124;
    margin: 0;
}

.detail-content {
    padding: 1rem;
}

.detail-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f3f4;
}

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

.detail-label {
    color: #5f6368;
    font-size: 0.875rem;
}

.detail-value {
    color: #202124;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: right;
}

.detail-link {
    color: #1a73e8;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: right;
    display: block;
}

.detail-link:hover {
    text-decoration: underline;
    color: #1557b0;
}

/* What's New Section */
.whats-new-section {
    margin: 2rem 0;
    padding: 1.5rem 0;
    border-bottom: 1px solid #e8eaed;
}

.version-info {
    margin-bottom: 1rem;
}

.version-number {
    background: #e8f0fe;
    color: #1a73e8;
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
}

.update-date {
    color: #5f6368;
    font-size: 0.75rem;
}

.changes-text {
    color: #5f6368;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-line;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease-in-out;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: 5% auto;
    background: transparent;
    border-radius: 8px;
    overflow: hidden;
}

.lightbox-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 30px;
    font-weight: bold;
    padding: 20px 15px;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.lightbox-prev {
    left: 15px;
}

.lightbox-next {
    right: 15px;
}

.lightbox-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.app-header-section,
.screenshots-section,
.description-section,
.ratings-section,
.whats-new-section {
    animation: fadeIn 0.3s ease-out;
}

/* Staggered animation for cards */
.detail-card:nth-child(1) { animation-delay: 0.1s; }
.detail-card:nth-child(2) { animation-delay: 0.2s; }
.detail-card:nth-child(3) { animation-delay: 0.3s; }
.detail-card:nth-child(4) { animation-delay: 0.4s; }

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-header-section {
        padding: 1rem 0;
    }
    
    .app-icon {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }
    
    .app-title {
        font-size: 1.5rem;
    }
    
    .app-category-rating {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .quick-info-row {
        gap: 0.5rem;
    }
    
    .quick-info-item {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .ratings-overview {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .overall-rating {
        text-align: left;
    }
    
    .rating-score {
        font-size: 2.5rem;
    }
    
    .rating-stars-large {
        justify-content: flex-start;
    }
    
    .app-details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .detail-item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }
    
    .detail-value,
    .detail-link {
        text-align: left;
    }
    
    .screenshots-gallery {
        gap: 10px;
    }
    
    .screenshot-item {
        max-width: 150px;
    }
    
    .screenshot-image {
        height: 250px;
    }
    
    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
    
    .lightbox-nav {
        font-size: 24px;
        padding: 15px 10px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    /* Reviews Mobile Optimizations */
    .reviews-header-info {
        text-align: center;
    }
    
    .reviews-pagination .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .reviews-pagination .page-item {
        margin: 0.125rem;
    }
    
    .review-item {
        margin: 0.75rem;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 1.25rem;
    }
    
    .rating-score {
        font-size: 2rem;
    }
    
    .version-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .lightbox-content {
        max-width: 95%;
        margin: 2% auto;
    }
}

/* Dark Theme Support */
@media (prefers-color-scheme: dark) {
    .android-app-section {
        background: #1a1a1a;
        color: #e8eaed;
    }
    
    .app-title {
        color: #e8eaed;
    }
    
    .app-developer {
        color: #8ab4f8;
    }
    
    .detail-card {
        background: #2d2d2d;
        border-color: #5f6368;
    }
    
    .detail-header {
        background: #3c4043;
        border-bottom-color: #5f6368;
    }
    
    .detail-title {
        color: #e8eaed;
    }
    
    .detail-value {
        color: #e8eaed;
    }
    
    .detail-link {
        color: #8ab4f8;
    }
    
    .review-item {
        background: #2d2d2d;
        border-color: #5f6368;
    }
}