html { overflow-x: hidden; }
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Screenshots Gallery (Play Store style) */
.app-screenshots {
    margin-top: 1rem;
}
r
.screenshots-wrapper {
    position: relative;
    overflow: hidden; /* keep scrollbars and overflow tidy */
}

.screenshots-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 6px 8px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-padding-left: 20px; /* ensure first card snaps with padding */
    scroll-padding-right: 20px;
    touch-action: pan-x; /* allow horizontal swipe without vertical hijack */
    max-width: 100%;
    overflow-y: hidden;
}

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

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

.screenshot-img {
    width: clamp(220px, 22vw, 320px);
    height: auto;
    border-radius: 16px;
    box-shadow: 0 6px 22px rgba(0,0,0,0.18);
    object-fit: cover;
    scroll-snap-align: start;
    user-select: none;
    -webkit-user-drag: none;
    flex: 0 0 auto; /* prevent flex from shrinking */
    display: block;
}

.screenshots-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 5;
    transition: background 0.2s ease, transform 0.2s ease;
}

.screenshots-nav:hover { background: rgba(0,0,0,0.6); transform: translateY(-50%) scale(1.05); }
.screenshots-nav:active { transform: translateY(-50%) scale(0.98); }
.screenshots-nav.prev { left: -10px; }
.screenshots-nav.next { right: -10px; }

@media (max-width: 992px) { .screenshot-img { width: clamp(200px, 28vw, 300px); } }

@media (max-width: 768px) {
    .screenshot-img { width: 35vw; border-radius: 12px; }
    .screenshots-nav { display: none; }
}

@media (max-width: 480px) { .screenshot-img { width: 72vw; } }

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
    overflow-x: hidden; /* prevent accidental horizontal page scroll */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #0a4919 0%, #0d5b20 50%, #129430 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    font-size: 1.8rem;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    opacity: 0.8;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: white;
    border-radius: 1px;
}

.search-container {
    position: relative;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: none;
    border-radius: 25px;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
}

/* Removed Hero Section */

/* Featured Apps Section */
.featured-apps {
    padding: 2rem 0;
    background: linear-gradient(135deg, #F5F5DC 0%, #FFF8DC 100%);
    min-height: 100vh;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #64748b;
}

.filter-tab:hover,
.filter-tab.active {
    background: #8B4513;
    color: white;
    border-color: #8B4513;
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.app-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e2e8f0;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.app-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.app-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.app-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.app-developer {
    color: #64748b;
    font-size: 0.9rem;
}

.app-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stars {
    display: flex;
    gap: 0.1rem;
}

.star {
    color: #fbbf24;
    font-size: 0.9rem;
}

.rating-text {
    color: #64748b;
    font-size: 0.9rem;
}

.app-description {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-size {
    color: #64748b;
    font-size: 0.9rem;
}

.download-btn {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #D2691E 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.4);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #64748b;
    z-index: 1;
}

.close:hover {
    color: #2d3748;
}

.modal-body {
    padding: 2rem;
}

.app-details {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.app-details .app-icon {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    flex-shrink: 0;
}

.app-info {
    flex: 1;
    min-width: 0; /* allow flex child to shrink and wrap */
    display: flex;
    flex-direction: column;
}

.app-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.app-info p {
    color: #64748b;
    margin-bottom: 1rem;
    overflow-wrap: anywhere; /* wrap very long continuous strings */
    word-break: break-word;
}

/* Ensure the description never overflows its container */
#appDescription {
    white-space: break-spaces;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    display: block; /* inside flex, ensure it behaves like a block */
}

/* Clamp description to 3 lines by default, expandable via JS */
#appDescription.clamped {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	white-space: normal; /* override break-spaces so line clamp can apply */
}

.read-more-btn {
	background: none;
	border: none;
	color: #1a73e8;
	font-weight: 600;
	cursor: pointer;
	padding: 4px 0;
	align-self: flex-start;
}
.read-more-btn:hover { text-decoration: underline; }

.app-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.detail-item span:last-child {
    color: #2d3748;
    font-weight: 600;
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #4a5568;
    padding-top: 1rem;
    text-align: center;
    color: #a0aec0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .search-container {
        order: 2;
        width: 100%;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-tabs {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
    }
    
    .app-details {
        flex-direction: column;
        text-align: center;
    }
    
    .app-details .app-icon {
        align-self: center;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .featured-apps {
        padding: 2rem 0;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
    
    .app-card {
        padding: 1rem;
    }
    
    .app-details-section {
        padding: 1rem;
    }
}

/* Loading Animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search Results */
.search-results {
    margin-bottom: 2rem;
    color: #64748b;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Reviews Section */
.reviews-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.reviews-section h3 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.reviews-container {
    margin-bottom: 2rem;
}

.review-item {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.reviewer-info h4 {
    color: #2d3748;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

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

.review-date {
    color: #64748b;
    font-size: 0.9rem;
}

.review-comment {
    color: #4a5568;
    line-height: 1.6;
    margin: 0;
}

.no-reviews {
    text-align: center;
    color: #64748b;
    font-style: italic;
    padding: 2rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* Review Form */
.review-form-section {
    background: #f8fafc;
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e2e8f0;
}

.review-form-section h4 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.review-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: #2d3748;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Rating Input */
.rating-input {
    display: flex;
    flex-direction: row;
    gap: 0.25rem;
    align-items: center;
}
.star-label {
    font-size: 32px;  /* adjust to the size you want */
    cursor: pointer;
}


.rating-input input[type="radio"] {
    display: none;
}

.star-label {
    font-size: 1.5rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s ease;
}

.rating-input input[type="radio"]:checked ~ .star-label,
.rating-input input[type="radio"]:checked ~ .star-label ~ .star-label,
.star-label:hover,
.star-label:hover ~ .star-label {
    color: #fbbf24;
}

.rating-input input[type="radio"]:checked ~ .star-label {
    color: #fbbf24;
}

/* Version Selector */
.version-selector {
    margin: 1.5rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.version-selector label {
    color: #2d3748;
    font-weight: 500;
    font-size: 0.9rem;
}

.version-dropdown {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    color: #2d3748;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.version-dropdown:focus {
    outline: none;
    border-color: #8B4513;
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.version-dropdown option {
    padding: 0.5rem;
}

/* Submit Review Button */
.submit-review-btn {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #D2691E 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
}

.submit-review-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.4);
}

/* Download Count Animation */
.download-count {
    font-weight: 600;
    color: #8B4513;
}

.download-count.updated {
    animation: countUpdate 0.5s ease;
}

@keyframes countUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #A0522D; }
    100% { transform: scale(1); }
}

/* Responsive Reviews */
@media (max-width: 768px) {
    .reviews-section {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
    
    .review-item {
        padding: 1rem;
    }
    
    .review-form-section {
        padding: 1.5rem;
    }
    
    .rating-input {
        justify-content: center;
    }
    
    .star-label {
        font-size: 2rem;
    }
}

.app-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0.5rem 0 1rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #edf2f7;
    color: #4a5568;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
}

.chip i { color: #8B4513; }

/* Sticky mobile install bar */
.mobile-install-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.08);
    padding: 10px 14px;
    z-index: 1500;
}

.mobile-install-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mobile-install-content img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.mobile-app-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.mobile-app-meta #mobileAppName {
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-app-sub { color: #718096; font-size: 0.85rem; }

.mobile-install-btn { border-radius: 10px; padding: 10px 14px; }

@media (min-width: 769px) {
    .mobile-install-bar { display: none !important; }
}

.app-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.app-head-left h3 { margin-bottom: 0.25rem; }
.app-head-left p { margin-bottom: 0.25rem; color: #64748b; }

.app-actions { flex-shrink: 0; }

.primary-install {
    background: #1aa34a; /* Play green */
    border-radius: 999px;
    padding: 0.6rem 1.25rem;
}

.primary-install:hover {
    box-shadow: 0 6px 18px rgba(26,163,74,0.35);
    transform: translateY(-1px);
}

/* tighten chips spacing */
.app-meta-chips { margin-top: 0.25rem; }
.chip { padding: 5px 10px; font-size: 0.82rem; }

@media (max-width: 768px) {
    .app-head { flex-direction: column; align-items: flex-start; }
    .app-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .primary-install { width: 100%; text-align: center; }
    .share-btn { width: 100%; text-align: center; }
}

/* App Details Mobile Responsiveness */
@media (max-width: 768px) {
	.app-details {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 1rem;
	}
	.app-details .app-icon {
		width: 96px;
		height: 96px;
		margin: 0 auto;
	}
	.app-info {
		width: 100%;
	}
	.app-head {
		flex-direction: column;
		align-items: stretch;
		text-align: left;
		gap: 0.75rem;
	}
	.app-actions {
		width: 100%;
	}
	.primary-install {
		width: 100%;
	}
	.app-meta-chips {
		gap: 6px;
	}
	#appDescription {
		font-size: 0.95rem;
	}
}

/* Improve small phone layout */
@media (max-width: 480px) {
	.section-header h2 { font-size: 1.6rem; }
	.app-details .app-icon { width: 88px; height: 88px; }
	.chip { font-size: 0.8rem; padding: 5px 9px; }
}

/* Safe area padding when mobile install bar is visible */
body.has-mobile-install-bar {
	padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 64px);
}
