@font-face {
    font-family: 'UKIJ Ekran';
    src: url('https://dilkan.ulunix.cn/Static/home/fonts/UKIJEKRAN.ttf') format('truetype');
    font-display: swap;
}

:root {
    --primary: #6c5ce7;
    --primary-dark: #5649c0;
    --secondary: #fd79a8;
    --accent: #00cec9;
    --background: linear-gradient(135deg, rgba(26, 42, 108, 0.95) 0%, rgba(178, 31, 31, 0.95) 50%, rgba(253, 187, 45, 0.95) 100%);
    --card: rgba(255, 255, 255, 0.98);
    --text: #2d3436;
    --text-light: #636e72;
    --shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    --gradient: linear-gradient(135deg, #6c5ce7 0%, #fd79a8 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'UKIJ Ekran', 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    backdrop-filter: blur(10px);
    padding-top: 60px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1001;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary);
}

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

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

.search-container {
    margin: 20px 0 40px;
}

.search-bar {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
}

.search-bar i {
    color: var(--primary);
    font-size: 1.2rem;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    color: var(--text);
    outline: none;
    text-align: right;
    direction: rtl;
}

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

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 10px 0;
    margin-bottom: 40px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.app-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    color: var(--text);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    -webkit-backface-visibility: hidden;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

.app-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.app-card:hover::before {
    transform: scaleX(1);
}

.app-icon-container {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    font-size: 36px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.app-card:hover .app-icon-container {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 20px rgba(0, 0, 0, 0.3);
}

.app-icon-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.app-info {
    text-align: center;
    margin-bottom: 20px;
}

.app-name {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.app-category {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.app-description {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 15px;
}

.app-meta {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: auto;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.meta-item i {
    color: var(--primary);
}

/* چۈشۈرۈش تەكشۈكلىرى */
.download-options {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    text-decoration: none;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
}

.download-btn.secondary {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary);
}

.download-btn.secondary:hover {
    background: rgba(108, 92, 231, 0.2);
}

/* چۈشۈرۈش جەريانى */
.download-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px) saturate(180%);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    min-width: 300px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.download-progress.active {
    display: flex;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(108, 92, 231, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 5px;
}

.cancel-download {
    background: transparent;
    border: 1px solid var(--text-light);
    color: var(--text-light);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.cancel-download:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #ff3b30;
    border-color: #ff3b30;
}

/* چۈشۈرۈش تارىخى */
.download-history {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px;
    margin-top: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(40px) saturate(180%);
}

.history-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.history-list::-webkit-scrollbar {
    display: none;
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: rgba(108, 92, 231, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(108, 92, 231, 0.1);
}

.history-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.history-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.history-name {
    font-weight: 600;
    color: var(--text);
}

.history-time {
    font-size: 0.85rem;
    color: var(--text-light);
}

.history-actions {
    display: flex;
    gap: 10px;
}

.history-btn {
    background: transparent;
    border: 1px solid var(--text-light);
    color: var(--text-light);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.history-btn:hover {
    background: rgba(108, 92, 231, 0.1);
    color: var(--primary);
    border-color: var(--primary);
}

/* ئارقا فون */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1999;
    display: none;
}

.overlay.active {
    display: block;
}

.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 25px 20px;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.1);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-link:hover {
    color: var(--primary);
}

.copyright {
    color: var(--text-light);
    font-size: 0.85rem;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 25px;
    opacity: 0.6;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.empty-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-light);
    font-weight: 600;
}

.empty-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 30px;
}

.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(40px) saturate(180%);
    color: #333;
    padding: 15px 25px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    max-width: 300px;
}

.notification.show {
    transform: translateX(0);
}

/* تېلېفون ئېكران ئۇسلۇبلىرى */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
        padding-bottom: 20px;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .main-container {
        padding: 15px;
        margin: 0 auto;
        max-width: 100%;
    }
    
    .main-container > * {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }
    
    .search-container,
    .apps-grid,
    .download-history {
        padding-left: 0;
        padding-right: 0;
    }
    
    .search-container {
        margin: 15px 0 30px;
    }
    
    .search-bar {
        padding: 12px 18px;
        border-radius: 12px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }
    
    .search-input {
        font-size: 1rem;
        padding: 5px 0;
        -webkit-appearance: none;
        appearance: none;
        border-radius: 0;
    }
    
    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .app-card {
        border-radius: 16px;
        padding: 20px;
        margin: 0 5px;
        box-shadow: 
            0 10px 25px rgba(0, 0, 0, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    
    .app-card:hover {
        transform: translateY(-5px);
        box-shadow: 
            0 20px 40px rgba(0, 0, 0, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
    }
    
    .app-icon-container {
        width: 70px;
        height: 70px;
        border-radius: 16px;
        margin-bottom: 15px;
        box-shadow: 
            0 8px 20px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
    
    .app-info {
        text-align: center;
        margin-bottom: 15px;
    }
    
    .app-name {
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 6px;
        line-height: 1.3;
    }
    
    .app-category {
        font-size: 0.9rem;
        margin-bottom: 8px;
        opacity: 0.8;
    }
    
    .app-description {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: 15px;
        opacity: 0.9;
    }
    
    .download-options {
        flex-direction: column;
        gap: 10px;
        margin-top: 15px;
    }
    
    .download-btn {
        width: 100%;
        padding: 12px 16px;
        border-radius: 10px;
        font-size: 0.9rem;
        font-weight: 600;
        justify-content: center;
        box-shadow: 0 5px 15px rgba(108, 92, 231, 0.3);
    }
    
    .download-progress {
        min-width: 85%;
        max-width: 320px;
        padding: 25px;
        border-radius: 16px;
    }
    
    .download-history {
        padding: 20px;
        border-radius: 16px;
        margin-top: 30px;
    }
    
    .history-item {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 15px;
        border-radius: 12px;
    }
    
    .history-info {
        justify-content: flex-start;
    }
    
    .history-actions {
        width: 100%;
        justify-content: center;
        gap: 10px;
    }
    
    .history-btn {
        flex: 1;
        justify-content: center;
        padding: 8px 12px;
    }
    
    .notification {
        max-width: 85%;
        right: 15px;
        left: 15px;
        margin: 0 auto;
        padding: 15px 20px;
    }
    
    .footer {
        padding: 20px 15px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .apps-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .app-card {
        padding: 18px;
    }
}

@media (max-width: 360px) {
    .app-card {
        padding: 16px;
        margin: 0 3px;
    }
    
    .app-icon-container {
        width: 60px;
        height: 60px;
        border-radius: 14px;
    }
    
    .app-name {
        font-size: 1.1rem;
    }
    
    .app-description {
        font-size: 0.82rem;
    }
    
    .download-btn {
        padding: 11px 14px;
        font-size: 0.85rem;
    }
    
    .search-bar {
        padding: 10px 16px;
    }
    
    .download-progress {
        min-width: 90%;
        padding: 20px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .header {
        height: 50px;
        padding: 0 15px;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .main-container {
        padding: 10px 15px;
    }
    
    .apps-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .app-card {
        padding: 15px;
    }
}

/* تېلېفوندا تېز ئىزدەش ۋە چۈشۈرۈشنىڭ رەڭ ئۆزگەرتىشى */
.download-btn:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

.touch-device .app-card {
    cursor: default;
}

.touch-device .download-btn:active {
    opacity: 0.8;
}

/* ئۈچ دېتال بىر قۇر ئەمەلىيەتلىشىشى */
@media (max-width: 768px) {
    .header,
    .main-container,
    .footer {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .search-bar,
    .app-card,
    .download-history,
    .download-progress {
        margin-left: 0;
        margin-right: 0;
    }
}