@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

:root {
    --bg-dark: #08080a;
    --card-bg: #121216;
    --glass-border: rgba(255, 255, 255, 0.05);
    --primary-glow: #00f2ff;
    --secondary-glow: #7000ff;
    --btn-gradient: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    --badge-red: #ff3b3b;
    --badge-purple: #a33bff;
    --text-white: #ffffff;
    --text-gray: #94a3b8;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-white);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Header - Centered Layout */
header {
    padding: 2rem 1rem;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.logo-img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-bottom: 1rem;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.brand-info h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.tagline {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-gray);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Search Bar - Modern Rounded */
.search-container {
    width: 100%;
    max-width: 400px;
    margin-top: 1.5rem;
    position: relative;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 14px 20px 14px 45px;
    color: white;
    font-size: 0.9rem;
    outline: none;
    transition: 0.3s;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.05);
}

.search-input:focus {
    border-color: var(--primary-glow);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.15);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
}

/* App Grid - Proper Spacing */
.container {
    padding: 2rem 1.2rem;
}

.app-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem; /* Increased spacing */
}

/* App Card - Redmod Style */
.app-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-card:active {
    transform: scale(0.98);
}

/* Badges */
.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    z-index: 10;
}

.badge-new { background: var(--badge-red); box-shadow: 0 0 10px var(--badge-red); }
.badge-premium { background: var(--badge-purple); box-shadow: 0 0 10px var(--badge-purple); }

/* Card Content Layout */
.card-top {
    display: flex;
    gap: 16px;
    margin-bottom: 1.5rem;
    align-items: center;
}

.app-icon-img {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    background: #1a1a20;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.app-info-text {
    flex: 1;
}

.app-info-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.rating-stars {
    color: #ffcc00;
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.app-info-text p {
    font-size: 0.8rem;
    color: var(--text-gray);
    line-height: 1.4;
}

/* Centered Download Button */
.download-btn-container {
    display: flex;
    justify-content: center;
}

.download-btn-small {
    width: 100%;
    background: var(--btn-gradient);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(0, 114, 255, 0.3);
}

.download-btn-small:active {
    transform: translateY(2px);
    box-shadow: 0 2px 10px rgba(0, 114, 255, 0.2);
}

/* Modal / Popup */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(15px);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    width: 100%;
    background: #0f0f14;
    border-top: 1px solid var(--glass-border);
    border-radius: 32px 32px 0 0;
    padding: 2.5rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active { display: flex; }
.modal-overlay.active .modal-content { transform: translateY(0); }

.modal-header {
    display: flex;
    gap: 20px;
    margin-bottom: 2rem;
}

.modal-icon {
    width: 85px;
    height: 85px;
    border-radius: 22px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.modal-title-info h2 {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.modal-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 2rem;
    padding: 1.2rem 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.meta-item { flex: 1; text-align: center; }
.meta-value { display: block; font-weight: 700; font-size: 1rem; }
.meta-label { font-size: 0.7rem; color: var(--text-gray); }

.download-btn-large {
    width: 100%;
    background: var(--btn-gradient);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 18px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 114, 255, 0.4);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
    margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

footer {
    padding: 3rem 2rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-gray);
    opacity: 0.4;
}

/* Sidebar Styles */
header {
    position: relative !important; /* Make header scroll with page */
}

.menu-btn {
    position: absolute;
    left: 15px;
    top: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 101;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background: #0f0f14;
    z-index: 999;
    padding: 2rem 1.5rem;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
}

.sidebar.active {
    left: 0;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-gray);
    font-size: 1.8rem;
    cursor: pointer;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2.5rem;
    margin-top: 1rem;
}

.sidebar-logo {
    width: 45px;
    height: 45px;
    border-radius: 10px;
}

.sidebar-brand h2 {
    font-size: 1.1rem;
    font-weight: 800;
}

.sidebar-brand p {
    font-size: 0.6rem;
    color: var(--text-gray);
    letter-spacing: 1px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.nav-link {
    text-decoration: none;
    color: var(--text-white);
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    transition: 0.2s;
}

.nav-link:active {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.sidebar-social {
    margin-top: auto;
    padding-top: 2rem;
}

.sidebar-social p {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
    text-align: center;
}

.social-btns {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.social-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    font-weight: 800;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    transition: 0.3s;
}

.social-btn.ig { border-color: #e1306c; color: #e1306c; }
.social-btn.yt { border-color: #ff0000; color: #ff0000; }
.social-btn.tg { border-color: #0088cc; color: #0088cc; }

.social-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.1);
}
