* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== LOADER ===== */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0f1a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-icon {
    font-size: 5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 1.5s ease-in-out infinite, bounce 0.6s ease-in-out infinite;
}

.loader-icon i {
    display: inline-block;
    animation: download 1s ease-in-out infinite;
}

@keyframes download {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.loader-text {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 1rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGlow 1.5s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5)); }
    50% { filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.8)); }
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 2px;
    margin: 1.5rem auto 0;
    overflow: hidden;
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6, #a855f7);
    border-radius: 2px;
    animation: loading 3s ease-out forwards;
}

@keyframes loading {
    0% { width: 0%; }
    20% { width: 25%; }
    50% { width: 60%; }
    80% { width: 85%; }
    100% { width: 100%; }
}

/* ===== DOWNLOAD TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: linear-gradient(135deg, rgba(21, 29, 46, 0.98), rgba(30, 41, 59, 0.95));
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.2);
    animation: slideIn 0.5s ease forwards;
    max-width: 320px;
    backdrop-filter: blur(10px);
    pointer-events: auto;
}

.toast.hiding {
    animation: slideOut 0.5s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(-120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(-120%);
        opacity: 0;
    }
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.toast-icon i {
    color: white;
    font-size: 1.1rem;
}

.toast-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.toast-message strong {
    color: var(--secondary);
}

.toast-time {
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #22d3ee;
    --bg-dark: #0a0f1a;
    --bg-card: #151d2e;
    --bg-hover: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --success: #22c55e;
    --warning: #f59e0b;
    --premium: #f472b6;
    --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
header {
    background: rgba(10, 15, 26, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.navbar {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i { font-size: 1.6rem; }

.search-box {
    display: flex;
    background: var(--bg-card);
    border-radius: 25px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    overflow: hidden;
    flex: 1;
    max-width: 600px;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.search-box input {
    background: transparent;
    border: none;
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    width: 100%;
    font-size: 0.9rem;
}

.search-box input::placeholder { color: var(--text-secondary); }
.search-box input:focus { outline: none; }

.search-box button {
    background: var(--gradient);
    border: none;
    padding: 0.6rem 1rem;
    color: white;
    cursor: pointer;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.25rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.nav-links a:hover { color: var(--primary); }

/* Hero - Compact */
.hero {
    background: linear-gradient(135deg, #0a0f1a 0%, #151d2e 50%, #0a0f1a 100%);
    padding: 2rem 1.5rem;
    text-align: center;
}

.hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat { text-align: center; }

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* Categories */
.categories {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    flex-wrap: wrap;
    max-width: 1600px;
    margin: 0 auto;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    font-size: 0.85rem;
}

.category-card:hover,
.category-card.active {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.category-card i {
    font-size: 0.9rem;
    color: var(--primary);
}

.category-card span {
    font-weight: 500;
    color: var(--text-primary);
}

/* Platform Filter */
.platform-filter {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
}

.platform-btn {
    padding: 0.4rem 1rem;
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.platform-btn:hover,
.platform-btn.active {
    background: var(--primary);
    color: white;
}

/* Software Section */
.software-section {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.software-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.software-section h2 i { color: var(--warning); }

.apps-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: normal;
    margin-left: auto;
}

/* COMPACT Software Grid */
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

/* COMPACT Software Card */
.software-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
}

.software-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.software-card.hidden { display: none; }

.card-header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #151d2e 0%, #1e293b 100%);
    position: relative;
    padding: 0.5rem;
}

.card-header img {
    max-height: 40px;
    max-width: 40px;
    object-fit: contain;
    border-radius: 8px;
}

.card-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--gradient);
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 600;
}

.card-badge.free {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.card-badge.premium {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
}

.card-body {
    padding: 0.6rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-body h3 {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-body p {
    font-size: 0.65rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    line-height: 1.3;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.card-meta i { margin-right: 0.2rem; }
.card-meta .fa-star { color: var(--warning); }

.card-footer {
    padding: 0.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    width: 100%;
    padding: 0.4rem;
    background: var(--gradient);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.7rem;
    transition: all 0.2s;
}

.btn-download:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

.btn-download.premium {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
}

/* Load More Button */
.load-more-container {
    text-align: center;
    padding: 1.5rem;
}

.btn-load-more {
    padding: 0.75rem 2rem;
    background: var(--bg-card);
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-load-more:hover {
    background: var(--primary);
    color: white;
}

/* Footer */
footer {
    background: var(--bg-card);
    padding: 2rem 1.5rem 1rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.footer-section h4 {
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.4rem;
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.footer-section a:hover { color: var(--primary); }

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: color 0.2s;
}

.social-links a:hover { color: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
    .navbar { padding: 0.5rem 1rem; }
    .nav-links { display: none; }
    .search-box { max-width: 100%; }
    .hero h1 { font-size: 1.5rem; }
    .software-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .categories { gap: 0.3rem; }
    .category-card { padding: 0.4rem 0.75rem; font-size: 0.75rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }
