:root {
    --primary-color: #722F37;
    --primary-dark: #5A272D;
    --primary-light: #8C3D45;
    --accent-color: #C8A2C8;
    --accent-dark: #B28FB2;
    --bg-white: #ffffff;
    --bg-light: #fdfcfc;
    --bg-lighter: #fbeced;
    --text-dark: #34171A;
    --text-light: #5A272D;
    --border-color: #e8c7ca;
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --border-radius-lg: 24px;
    --transition: all 0.3s ease;
    --shadow-light: 0 4px 20px rgba(114, 47, 55, 0.08);
    --shadow-medium: 0 8px 30px rgba(114, 47, 55, 0.12);
    --shadow-heavy: 0 12px 40px rgba(114, 47, 55, 0.15);
    --primary-gradient: linear-gradient(135deg, #722F37, #8C3D45);
    --accent-gradient: linear-gradient(135deg, #C8A2C8, #D4B4D4);
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #FF6B81;
        --primary-dark: #FF4757;
        --primary-light: #FF8A98;
        --accent-color: #9B7B9B;
        --accent-dark: #8A6A8A;
        --bg-white: #000000;
        --bg-light: #0A0A0A;
        --bg-lighter: #111111;
        --text-dark: #FFFFFF;
        --text-light: #E0E0E0;
        --border-color: #222222;
        --shadow-light: 0 4px 20px rgba(255, 107, 129, 0.08);
        --shadow-medium: 0 8px 30px rgba(255, 107, 129, 0.12);
        --shadow-heavy: 0 12px 40px rgba(255, 107, 129, 0.15);
        --primary-gradient: linear-gradient(135deg, #FF6B81, #FF8A98);
        --accent-gradient: linear-gradient(135deg, #9B7B9B, #8A6A8A);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    tap-highlight-color: transparent;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #fdfcfc 0%, #fbeced 50%, #f8e1e4 100%);
    color: var(--text-dark);
    line-height: 1.6;
    padding-bottom: 80px;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 1200px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(114, 47, 55, 0.05);
}

@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #000000 0%, #0A0A0A 50%, #111111 100%);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
    }
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

.mobile-header {
    background: var(--bg-white);
    padding: 20px 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-light);
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
}

.mobile-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25px;
    right: 25px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.logo i {
    font-size: 26px;
    color: var(--primary-color);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    flex-shrink: 0;
}

.logo h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.5px;
}

.upload-btn {
    background: var(--primary-gradient);
    border: none;
    color: white;
    padding: 11px 22px;
    border-radius: var(--border-radius-lg);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-light);
    font-size: 14px;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.upload-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.upload-btn:hover::before {
    left: 100%;
}

.upload-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.search-container {
    position: relative;
    margin-bottom: 30px;
    padding: 0 25px;
    width: 100%;
}

.mobile-search {
    position: relative;
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-light);
    border: 1.5px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.mobile-search:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-medium);
}

.mobile-search i {
    color: var(--primary-color);
    font-size: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.mobile-search input {
    flex: 1;
    border: none;
    background: none;
    font-size: 15px;
    color: var(--text-dark);
    outline: none;
    font-family: 'Poppins', sans-serif;
    min-width: 0;
    width: 100%;
    font-weight: 400;
}

.mobile-search input::placeholder {
    color: var(--text-light);
    opacity: 0.6;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 25px;
    right: 25px;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    margin-top: 8px;
    box-shadow: var(--shadow-heavy);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.search-results.active {
    display: block;
    animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.search-result-item:hover {
    background: var(--bg-lighter);
}

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

.result-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    flex-shrink: 0;
    overflow: hidden;
    border: 1.5px solid var(--border-color);
    position: relative;
}

.result-icon img {
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
}

.result-icon i {
    color: var(--primary-color);
    font-size: 18px;
    opacity: 0.8;
}

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

.result-info h4 {
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.result-info p {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}

.search-no-results {
    padding: 24px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    opacity: 0.7;
}

.featured-section {
    margin-bottom: 35px;
    padding: 0 25px;
    width: 100%;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    width: 100%;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    padding-bottom: 8px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 1px;
}

.featured-scroller {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 4px 16px 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
}

.featured-scroller::-webkit-scrollbar {
    display: none;
}

.featured-app-card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 20px;
    width: 170px;
    height: 190px;
    box-shadow: var(--shadow-light);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.featured-app-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.featured-app-card .app-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid var(--border-color);
    transition: var(--transition);
}

.featured-app-card:hover .app-icon {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.featured-app-card .app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.app-icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
    border-radius: var(--border-radius);
}

.featured-app-card .app-content {
    text-align: center;
    width: 100%;
    min-width: 0;
}

.featured-app-card .app-name {
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-dark);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.featured-app-card .app-category {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}

.apps-section {
    margin-bottom: 35px;
    padding: 0 25px;
    width: 100%;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    color: var(--text-dark);
    font-size: 20px;
    font-weight: 600;
    width: 100%;
}

.section-title i {
    color: var(--primary-color);
    font-size: 18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-light);
    box-shadow: 0 4px 15px rgba(138, 64, 73, 0.3);
    flex-shrink: 0;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    .section-title i {
        box-shadow: 0 4px 15px rgba(255, 107, 129, 0.3);
    }
}

.see-more {
    margin-left: auto;
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.see-more:hover {
    opacity: 1;
    color: var(--primary-dark);
    background: var(--bg-lighter);
}

.apps-grid-container {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 8px 4px 16px 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
}

.apps-grid-container::-webkit-scrollbar {
    display: none;
}

.apps-grid-item {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 300px;
    flex-shrink: 0;
}

.app-card-list {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    min-height: 88px;
    position: relative;
}

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

.app-card-list .app-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--border-radius-sm);
    background: var(--bg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid var(--border-color);
    transition: var(--transition);
}

.app-card-list:hover .app-icon {
    border-color: var(--primary-color);
}

.app-card-list .app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-sm);
}

.app-card-list .app-content {
    flex: 1;
    min-width: 0;
}

.app-card-list .app-name {
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.app-card-list .app-meta {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.app-card-list .app-category {
    color: var(--primary-color);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}

.app-card-list .app-version {
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: auto;
    opacity: 0.7;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    color: var(--primary-color);
    width: 100%;
}

.loading-spinner i {
    font-size: 32px;
    margin-bottom: 12px;
    animation: spin 1.2s linear infinite;
    opacity: 0.7;
}

.loading-spinner p {
    color: var(--text-light);
    font-size: 14px;
    opacity: 0.8;
}

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

@media (max-width: 1200px) {
    body {
        max-width: 100%;
        box-shadow: none;
    }
    
    @media (prefers-color-scheme: dark) {
        body {
            box-shadow: none;
        }
    }
}

@media (max-width: 768px) {
    body {
        max-width: 100%;
        box-shadow: none;
    }
    
    .mobile-header {
        padding: 18px 20px;
        margin-bottom: 20px;
    }
    
    .search-container {
        padding: 0 20px;
        margin-bottom: 20px;
    }
    
    .featured-section {
        padding: 0 20px;
        margin-bottom: 25px;
    }
    
    .section-header {
        margin-bottom: 15px;
    }
    
    .featured-scroller {
        padding: 4px 4px 12px 4px;
    }
    
    .featured-app-card:hover {
        transform: translateY(-3px);
    }
    
    .apps-section {
        padding: 0 20px;
        margin-bottom: 25px;
    }
    
    .section-title {
        margin-bottom: 15px;
    }
    
    .apps-grid-container {
        padding: 4px 4px 12px 4px;
    }
    
    .apps-grid-item {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .mobile-header {
        padding: 16px 20px;
        margin-bottom: 16px;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .logo i {
        font-size: 22px;
    }
    
    .upload-btn {
        padding: 10px 18px;
        font-size: 13px;
    }
    
    .search-container {
        padding: 0 20px;
        margin-bottom: 16px;
    }
    
    .mobile-search {
        padding: 14px 18px;
    }
    
    .featured-section {
        padding: 0 20px;
        margin-bottom: 20px;
    }
    
    .section-header {
        margin-bottom: 12px;
    }
    
    .featured-scroller {
        padding: 4px 4px 10px 4px;
        gap: 12px;
    }
    
    .featured-app-card {
        width: 150px;
        height: 170px;
        padding: 16px;
    }
    
    .featured-app-card:hover {
        transform: translateY(-2px);
    }
    
    .featured-app-card .app-icon {
        width: 70px;
        height: 70px;
    }
    
    .apps-section {
        padding: 0 20px;
        margin-bottom: 20px;
    }
    
    .section-title {
        margin-bottom: 12px;
        font-size: 18px;
    }
    
    .see-more {
        font-size: 13px;
        padding: 5px 10px;
    }
    
    .apps-grid-container {
        padding: 4px 4px 10px 4px;
        gap: 12px;
    }
    
    .apps-grid-item {
        min-width: 280px;
        gap: 10px;
    }
    
    .app-card-list {
        padding: 14px;
        gap: 12px;
    }
    
    .app-card-list .app-icon {
        width: 48px;
        height: 48px;
    }
    
    .app-card-list .app-name {
        font-size: 13px;
    }
    
    .app-card-list .app-meta {
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .mobile-header {
        padding: 14px 16px;
        margin-bottom: 14px;
    }
    
    .search-container {
        padding: 0 16px;
        margin-bottom: 14px;
    }
    
    .featured-section {
        padding: 0 16px;
        margin-bottom: 18px;
    }
    
    .featured-scroller {
        padding: 2px 4px 8px 4px;
    }
    
    .featured-app-card {
        width: 140px;
        height: 160px;
    }
    
    .featured-app-card:hover {
        transform: translateY(-2px);
    }
    
    .apps-section {
        padding: 0 16px;
        margin-bottom: 18px;
    }
    
    .section-title {
        margin-bottom: 10px;
    }
    
    .apps-grid-container {
        padding: 2px 4px 8px 4px;
    }
    
    .apps-grid-item {
        min-width: 260px;
        gap: 8px;
    }
    
    .mobile-search {
        padding: 12px 16px;
    }
}