* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #ffffff;
    color: #1a1a1a;
    line-height: 1.6;
}

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

/* Header */
header {
    background: #000000;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.title-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.header-logo {
    width: 40px;
    height: 40px;
}

header h1 {
    font-size: 24px;
    margin-bottom: 0;
    font-weight: 600;
}

#search {
    width: 100%;
    max-width: 400px;
    padding: 10px 16px;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 14px;
    background: #1a1a1a;
    color: white;
    transition: border-color 0.2s;
}

#search:focus {
    outline: none;
    border-color: #666;
}

/* Ad Containers */
.ad-container {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    padding: 20px;
    margin: 20px auto;
    max-width: 1200px;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.ad-top, .ad-bottom {
    padding: 0;
    border: none;
    min-height: auto;
    max-width: 728px;
    background: transparent;
    overflow: hidden; /* Ensures the container respects the image aspect ratio */
}

.ad-top a, .ad-bottom a {
    display: block;
    line-height: 0; /* Removes any extra space below the image */
}

.ad-top img, .ad-bottom img {
    width: 100%;
    height: auto;
    display: block;
}

/* Site Intro Article */
.site-intro {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 30px;
    text-align: center;
}

.site-intro h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.site-intro p {
    font-size: 16px;
    color: #555;
    line-height: 1.7;
    max-width: 800px;
    margin: 0 auto 10px;
}

/* Views */
.view {
    display: none;
    padding: 40px 0;
    min-height: 400px;
}

.view.active {
    display: block;
}

/* App Grid */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.app-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.app-card:hover,
.app-card:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    outline: 2px solid #000;
}

.app-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    margin-bottom: 12px;
    object-fit: cover;
}

.app-card h3 {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.app-card-date {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
}

/* Badge Styles */
.app-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
}

.app-badge.vip {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.4);
}

.app-badge.free {
    background: #28a745;
    color: white;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.app-icon-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.app-badge-large {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: none;
}

.app-badge-large.vip {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.5);
}

.app-badge-large.free {
    background: #28a745;
    color: white;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.4);
}

/* New button styles for app card */
.btn-card-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-card-download:hover,
.btn-card-download:focus {
    background-color: #0056b3;
    outline: none;
}

.android-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}


/* App Detail */
.app-detail {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.video-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    margin: 24px 0;
    border-radius: 8px;
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.app-icon-large {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    margin-bottom: 20px;
    object-fit: cover;
}

.app-detail h2 {
    font-size: 28px;
    margin-bottom: 12px;
    font-weight: 600;
}

.stars {
    font-size: 20px;
    color: #ffa500;
    margin-bottom: 16px;
}

.description {
    color: #666;
    margin-bottom: 20px;
    font-size: 16px;
}

.download-info {
    margin: 20px 0;
}

.download-count, .release-date {
    display: inline-block;
    background: #f5f5f5;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    margin: 4px;
}

/* Buttons */
.btn-primary, .btn-success {
    background: #007bff;
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
    margin-top: 12px;
}

.app-detail #btn-start-download {
    width: 100%;
    max-width: 450px;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
    background: #0056b3;
    outline: none;
}

.btn-success {
    background: #007bff;
    font-size: 18px;
    padding: 16px 40px;
}

.btn-success span {
    font-size: 24px;
    margin-right: 8px;
}

.btn-success:hover,
.btn-success:focus {
    background: #0056b3;
    outline: none;
}

.back-btn, .back-btn-small {
    background: transparent;
    border: 1px solid #e0e0e0;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 20px;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}

.back-btn:hover,
.back-btn:focus,
.back-btn-small:hover,
.back-btn-small:focus {
    border-color: #0056b3;
    background-color: #e6f2ff;
    color: #0056b3;
    outline: none;
}

/* Countdown */
.countdown-container {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.countdown-app-title {
    font-size: 22px;
    font-weight: 500;
    margin-top: 10px;
    margin-bottom: 8px;
}

.countdown-container h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.countdown-circle {
    width: 150px;
    height: 150px;
    border: 4px solid #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
}

#countdown-number {
    font-size: 48px;
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.progress-fill {
    height: 100%;
    background: #000;
    width: 0%;
    transition: width 0.1s linear;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a1a;
    color: white;
    padding: 16px 24px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.error-message {
    background: #fff5f5;
    border: 1px solid #ffcccc;
    padding: 20px;
    border-radius: 4px;
    margin-top: 20px;
}

.error-message p {
    color: #cc0000;
    margin-bottom: 12px;
}

/* Telegram Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.popup {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.popup-overlay.show .popup {
    transform: scale(1);
}

.popup .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f0f0f0;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 30px;
    text-align: center;
    cursor: pointer;
    color: #888;
    transition: background-color 0.2s, color 0.2s;
}

.popup .close-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.popup-content .telegram-icon-popup {
    width: 60px;
    height: 60px;
    color: #0088cc;
    margin-bottom: 15px;
}

.popup-content h2 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.popup-content p {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
}

.btn-telegram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background-color: #0088cc;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    width: 100%;
}

.btn-telegram:hover {
    background-color: #0077b3;
}

.btn-telegram .telegram-icon-btn {
    width: 20px;
    height: 20px;
}

/* Footer */
footer {
    background: #000000;
    color: white;
    text-align: center;
    padding: 25px 0;
    margin-top: 30px;
}

footer p {
    margin: 0;
    font-size: 14px;
    color: #a0a0a0;
}

/* Responsive */
@media (max-width: 768px) {
    .app-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }

    .app-icon {
        width: 60px;
        height: 60px;
    }

    .app-icon-large {
        width: 100px;
        height: 100px;
    }

    .app-detail h2 {
        font-size: 24px;
    }

    header h1 {
        font-size: 20px;
    }
}