* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary: #f59e0b;
    --background: #ffffff;
    --surface: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --success: #10b981;
    --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --nav-height: 50px;
}

body {
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.4;
    padding-bottom: var(--nav-height);
    font-size: 13px;
}

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

/* Header */
.header {
    background: var(--background);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.logo-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--surface);
    border-radius: 10px;
    padding: 6px 12px;
    flex: 1;
    max-width: 200px;
    margin: 0 12px;
    gap: 6px;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 12px;
    color: var(--text-primary);
}

.search-bar i {
    font-size: 12px;
    color: var(--text-muted);
}

.user-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.icon-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 24px 0;
    margin-bottom: 16px;
    border-radius: 0 0 16px 16px;
}

.hero-content {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.hero p {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 16px;
}

.cta-button {
    background: white;
    color: var(--primary);
    padding: 8px 16px;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    font-size: 12px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Categories */
.categories-section {
    margin-bottom: 16px;
}

.section-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.view-all {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.categories-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    width: 70px;
}

.category-card:hover,
.category-card.active {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--card-shadow);
}

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

.category-icon {
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--primary);
}

.category-card.active .category-icon {
    color: white;
}

.category-name {
    font-weight: 600;
    font-size: 10px;
}

/* Apps Grid - Updated Layout */
.apps-section {
    margin-bottom: 16px;
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.app-card {
    background: var(--surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    padding: 12px;
    display: flex;
    gap: 12px;
    height: 110px;
}

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

/* ĐÃ SỬA: Logo căn giữa và không bị thụt xuống */
.app-logo {
    width: 90px;
    height: 90px;
    border-radius: 21px;
    object-fit: contain;
    flex-shrink: 0;
    padding: 4px;
    align-self: center; /* Thêm dòng này để căn giữa theo chiều dọc */
}

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

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px; /* ĐÃ SỬA: Giảm khoảng cách xuống */
}

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

.app-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px; /* ĐÃ SỬA: Giảm khoảng cách xuống */
}

.app-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 500;
}

.app-meta {
    display: flex;
    gap: 12px;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 2px; /* ĐÃ SỬA: Giảm khoảng cách xuống */
}

.app-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-meta-item i {
    font-size: 9px;
    width: 12px;
    margin-right: -4px;
}

/* ĐÃ SỬA HOÀN TOÀN: Mô tả hiển thị xuống dòng đúng */
.app-description {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    margin-top: -4px;
    margin-bottom: -8px;
    white-space: pre-line; /* QUAN TRỌNG: Giữ nguyên xuống dòng */
    word-break: break-word; /* Ngắt từ khi cần thiết */
}

/* MỚI: Style cho description với icon check có nền tròn */
.app-description-check {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    margin-top: -4px;
    margin-bottom: -8px;
}

.description-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 2px;
}

.check-icon-container {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: #2693eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.check-icon-container i {
    font-size: 6px;
    color: #ffffff;

}

.description-text {
    flex: 1;
    line-height: 1.3;
margin-left : -3.65px;
margin-top : -1px;
}

.app-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px; /* ĐÃ SỬA: Giảm khoảng cách xuống */
}

.download-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.download-btn:hover {
    background: var(--primary-dark);
}

/* Featured Section */
.featured-section {
    margin-bottom: 16px;
}

.featured-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    padding: 16px;
    color: white;
    position: relative;
    overflow: hidden;
}

.featured-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    margin-bottom: 8px;
    display: inline-block;
}

.featured-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 6px;
}

.featured-description {
    font-size: 11px;
    opacity: 0.9;
    margin-bottom: 12px;
    line-height: 1.3;
    white-space: pre-line; /* Đảm bảo featured cũng xuống dòng */
}

.featured-image {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: 50px;
    height: 50px;
    border-radius: 10px;
}

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

.search-modal-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--background);
    border-radius: 0 0 20px 20px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.search-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.search-modal-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    background: var(--surface);
    outline: none;
}

.search-modal-input:focus {
    border-color: var(--primary);
}

.close-search {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
}

.search-results {
    max-height: 70vh;
    overflow-y: auto;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--background);
    border-top: 1px solid var(--border);
    padding: 6px 0;
    z-index: 1000;
}

.nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    flex: 1;
    padding: 4px 0;
}

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

.nav-icon {
    font-size: 16px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 9px;
    font-weight: 500;
}

/* Loading */
.loading {
    text-align: center;
    padding: 30px 16px;
    color: var(--text-secondary);
    font-size: 12px;
}

.loading-spinner {
    border: 2px solid var(--border);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 8px;
}

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

/* No Results */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.no-results i {
    font-size: 40px;
    margin-bottom: 12px;
    color: var(--text-muted);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

.skeleton-app-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    height: 110px;
}

.skeleton-logo {
    width: 90px;
    height: 90px;
    border-radius: 21px;
    align-self: center; /* ĐÃ SỬA: Căn giữa skeleton logo */
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px; /* ĐÃ SỬA: Giảm khoảng cách giữa các phần tử skeleton */
}

.skeleton-title {
    height: 16px;
    width: 70%;
}

.skeleton-tags {
    display: flex;
    gap: 4px;
}

.skeleton-tag {
    height: 14px;
    width: 40px;
    border-radius: 4px;
}

.skeleton-meta {
    height: 12px;
    width: 50%;
}

.skeleton-description {
    height: 12px;
    width: 90%;
}

.skeleton-description.short {
    width: 60%;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .search-bar {
        margin: 0 8px;
        max-width: 180px;
    }
    
    .hero h1 {
        font-size: 16px;
    }
    
    .app-card {
        padding: 10px;
        gap: 10px;
        height: 105px;
    }
    
    .app-logo {
        width: 90px;
        height: 90px;
    }
    
    .app-name {
        font-size: 14px;
    }
    
    .featured-image {
        width: 45px;
        height: 45px;
        margin-bottom: -12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .apps-grid {
        grid-template-columns: 1fr;
    }
    
    .logo {
        font-size: 14px;
    }
    
    .logo-icon {
        width: 24px;
        height: 24px;
    }
    
    .search-bar {
        margin: 0 6px;
        padding: 5px 10px;
        max-width: 150px;
    }
    
    .hero {
        padding: 20px 0;
    }
    
    .hero h1 {
        font-size: 15px;
    }
    
    .app-card {
        height: 100px;
    }
    
    .app-logo {
        width: 90px;
        height: 90px;
    }
    
    .app-name {
        font-size: 13px;
    }
    
    .app-description {
        font-size: 10px;
    }
    
    .category-card {
        width: 65px;
        padding: 8px 6px;
    }

    .nav-label {
        font-size: 8px;
    }
}
