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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0f0f23, #1a1a2e, #16213e);
    color: #e4e4e7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated background elements - Optimized for mobile */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
    z-index: -1;
    will-change: transform, opacity;
    transform: translateZ(0);
}

@keyframes pulse {
    0%, 100% { transform: translateZ(0) scale(1) rotate(0deg); opacity: 0.3; }
    50% { transform: translateZ(0) scale(1.1) rotate(180deg); opacity: 0.1; }
}

/* Reduce motion for mobile devices */
@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
    body::before {
        animation-duration: 12s;
        animation-timing-function: linear;
    }
}

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

.header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #8b5cf6, #06b6d4, #10b981);
    border-radius: 2px;
    animation: shimmer 2s linear infinite;
}

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

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, #8b5cf6, #06b6d4, #10b981);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    color: #a1a1aa;
    font-weight: 400;
    margin-bottom: 40px;
}

.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto 40px;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.search-container:focus-within {
    transform: translateY(-2px);
}

#search {
    width: 100%;
    padding: 20px 24px 20px 60px;
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: #e4e4e7;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#search:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1), 0 12px 40px rgba(0, 0, 0, 0.4);
}

#search::placeholder {
    color: #71717a;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #8b5cf6;
    font-size: 20px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: none;
    width: 100px;
    flex-shrink: 0;
    pointer-events: none;
    user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stat-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #8b5cf6;
    display: block;
    line-height: 1;
}

.stat-label {
    display: none;
}

#app-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    will-change: transform;
    transform: translateZ(0);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
    will-change: left;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    transform: translateZ(0) translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.25);
    border-color: rgba(139, 92, 246, 0.4);
}

/* Disable heavy animations on mobile */
@media (max-width: 768px) {
    .card {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        backdrop-filter: blur(10px);
    }
    
    .card::before {
        display: none;
    }
    
    .card:hover {
        transform: translateZ(0) translateY(-4px) scale(1.01);
        box-shadow: 0 10px 30px rgba(139, 92, 246, 0.2);
    }
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.card img, .card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    margin-right: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    will-change: transform;
    transform: translateZ(0);
}

.card:hover img {
    transform: translateZ(0) scale(1.1);
}

.card:hover .card-icon {
    transform: translateZ(0) scale(1.1);
}

/* Optimize for mobile */
@media (max-width: 768px) {
    .card img, .card-icon {
        transition: none;
    }
    
    .card:hover img,
    .card:hover .card-icon {
        transform: translateZ(0) scale(1.05);
    }
}

.card-icon {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

.card-info {
    flex: 1;
}

.app-name {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: #f4f4f5;
    letter-spacing: -0.01em;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.status.green {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status.red {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status.orange {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(249, 115, 22, 0.1));
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.status-icon {
    font-size: 12px;
}

.card-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: flex-end;
}

.action-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    will-change: transform;
    transform: translateZ(0);
}

/* Reduce animations on mobile */
@media (max-width: 768px) {
    .action-btn {
        transition: none;
    }
    
    .action-btn:active {
        transform: translateZ(0) scale(0.95);
    }
}

.install-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
}

.about-btn {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.3);
}

.about-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4);
}

/* Popup Styles */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
    padding: 20px;
}

.popup.visible {
    opacity: 1;
    pointer-events: all;
}

.popup.hidden {
    opacity: 0;
    pointer-events: none;
}

.popup-content {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 24px;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.8) translateY(40px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.popup.visible .popup-content {
    transform: scale(1) translateY(0);
}

#popup-close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 24px;
    cursor: pointer;
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    transition: all 0.3s ease;
}

#popup-close:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

#popup-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #8b5cf6;
    margin-bottom: 24px;
    padding-right: 50px;
}

.tab-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-button {
    padding: 12px 20px;
    border: none;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    color: #a1a1aa;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-button:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    transform: translateY(-2px);
}

.tab-button.active {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border-color: #8b5cf6;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.tab-content {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    min-height: 200px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
}

.tab-content.about-content {
    font-family: 'Inter', system-ui, sans-serif;
    text-align: center;
    white-space: normal;
}

.tab-content.reason-content {
    font-family: 'Inter', system-ui, sans-serif;
    text-align: left;
    font-size: 15px;
    white-space: normal;
}

.screenshot {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.screenshot:hover {
    transform: scale(1.02);
}

.website-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    text-decoration: none;
    border-radius: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(6, 182, 212, 0.3);
}

.website-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(6, 182, 212, 0.4);
}

.loading-message, .error-message {
    padding: 40px;
    text-align: center;
    font-style: italic;
}

.loading-message {
    color: #8b5cf6;
}

.error-message {
    color: #ef4444;
}

.alternative-container {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.alternative-container:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.alternative-header h3 {
    color: #8b5cf6;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.alternative-header p {
    color: #a1a1aa;
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.no-results {
    text-align: center;
    padding: 80px 20px;
    color: #a1a1aa;
    grid-column: 1 / -1;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #71717a;
}

.no-results p {
    font-size: 1rem;
    opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }

    #app-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        padding: 20px;
        border-radius: 16px;
    }

    .stats {
        gap: 16px;
        flex-direction: row;
        justify-content: center;
    }

    .stat-item {
        width: 80px;
        padding: 12px 16px;
    }

    .popup-content {
        padding: 24px;
        border-radius: 20px;
        margin: 10px;
    }

    .tab-buttons {
        gap: 8px;
    }

    .tab-button {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .card img, .card-icon {
        width: 48px;
        height: 48px;
    }

    .action-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .search-container {
        max-width: 100%;
    }

    #search {
        padding: 16px 20px 16px 50px;
        font-size: 15px;
    }

    .search-icon {
        left: 16px;
        font-size: 18px;
    }

    .stats {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 12px;
    }

    .stat-item {
        width: 90px;
    }

    .card {
        padding: 16px;
        border-radius: 12px;
    }

    .card-header {
        margin-bottom: 12px;
    }

    .app-name {
        font-size: 1.1rem;
    }

    .popup-content {
        padding: 20px;
        margin: 5px;
    }

    #popup-title {
        font-size: 1.4rem;
        padding-right: 40px;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8b5cf6, #06b6d4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7c3aed, #0891b2);
}

/* Card entrance animation - Optimized */
@keyframes cardEnter {
    from {
        opacity: 0;
        transform: translateZ(0) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateZ(0) translateY(0);
    }
}

.card {
    animation: cardEnter 0.4s ease-out forwards;
    opacity: 0;
}

/* Disable entrance animation on mobile for better performance */
@media (max-width: 768px) {
    .card {
        animation: none;
        opacity: 1;
    }
}

/* Focus styles for accessibility */
.action-btn:focus,
.tab-button:focus,
#search:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.website-link:focus {
    outline: 2px solid #06b6d4;
    outline-offset: 2px;
        }
