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

:root {
    /* Colors */
    --primary-color: #4285f4;
    --primary-hover: #3367d6;
    --secondary-color: #34a853;
    
    /* Backgrounds - Made Darker for better contrast */
    --light-bg: #eef2f6;      /* Darker Grey/Blue for page background */
    --surface-bg: #ffffff;    /* Pure White for cards */
    
    /* Text */
    --dark-text: #1f2937;
    --light-text: #6b7280;
    
    /* Inputs */
    --input-bg: #f9fafb;      /* Light grey inside inputs */
    --border-color: #d1d5db;  /* Visible grey border */
    
    /* Shadows */
    --card-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --hover-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    
    --radius: 12px;
    --radius-btn: 50px;
}

/* Dark Mode */
body.dark-mode {
    --light-bg: #111827;
    --surface-bg: #1f2937;
    --dark-text: #f9fafb;
    --light-text: #9ca3af;
    --input-bg: #374151;
    --border-color: #4b5563;
    --card-shadow: none;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body { 
    background-color: var(--light-bg); 
    color: var(--dark-text); 
    display: flex; 
    flex-direction: column; 
    min-height: 100vh;
}

/* --- FORM INPUT VISIBILITY FIX --- */
/* This makes the box where users write CLEARLY visible */
.form-control, .form-select, textarea {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--dark-text) !important;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus, textarea:focus {
    background-color: var(--surface-bg) !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.15) !important;
}

/* Form Containers */
.auth-card, .form-section {
    background: var(--surface-bg);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 30px;
    border: 1px solid var(--border-color);
}

/* --- TABS & NAVIGATION --- */
.tabs-scroll {
    display: flex;
    gap: 10px;
    padding: 20px 0;
    overflow-x: auto;
    scrollbar-width: none; 
}
.tabs-scroll::-webkit-scrollbar { display: none; }

.tab-pill {
    padding: 8px 20px;
    border-radius: var(--radius-btn);
    background: var(--surface-bg);
    color: var(--light-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.tab-pill:hover { border-color: var(--primary-color); color: var(--primary-color); }

.tab-pill.active { 
    background: var(--primary-color); 
    color: white; 
    border-color: var(--primary-color); 
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

/* --- APP GRID --- */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
    padding-bottom: 60px;
}

.app-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
    padding: 12px;
    background: var(--surface-bg);
    border-radius: 16px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}

.app-card:hover { 
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.app-icon {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #f3f4f6;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.app-card:hover .app-icon img { transform: scale(1.05); }

.app-title { 
    font-size: 1rem; 
    font-weight: 600; 
    color: var(--dark-text); 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
}

.app-desc { 
    font-size: 0.85rem; 
    color: var(--light-text); 
    height: 38px; 
    overflow: hidden; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    line-height: 1.4;
}

.badge-cat {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}

.card-footer {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.price-text { font-size: 0.9rem; font-weight: 600; color: var(--dark-text); }
.price-text.free { color: var(--secondary-color); } 

.action-btn {
    padding: 6px 16px;
    border-radius: var(--radius-btn);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.action-btn.download { color: var(--primary-color); background: rgba(66, 133, 244, 0.1); }
.action-btn.download:hover { background: rgba(66, 133, 244, 0.2); }

.action-btn.buy { background: var(--primary-color); color: white; }
.action-btn.buy:hover { background: var(--primary-hover); }

/* --- UPLOAD ALERT --- */
.upload-alert {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--surface-bg);
    padding: 20px;
    border-radius: 16px;
    box-shadow: var(--hover-shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 350px;
    border-left: 5px solid #ea4335;
    z-index: 2000;
    opacity: 0;
    transform: translateY(50px);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 2s;
}

@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }

.upload-icon { font-size: 2rem; color: #ea4335; animation: bounce 2s infinite; }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% {transform: translateY(0);} 40% {transform: translateY(-10px);} 60% {transform: translateY(-5px);} }

.upload-text h4 { font-size: 1rem; margin-bottom: 2px; color: var(--dark-text); font-weight: 700; }
.upload-text p { font-size: 0.8rem; color: var(--light-text); margin-bottom: 8px; }

.close-alert { position: absolute; top: 5px; right: 10px; cursor: pointer; color: var(--light-text); font-size: 1.2rem; }

/* Mobile */
@media (max-width: 768px) {
    .app-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .app-desc { display: -webkit-box; -webkit-line-clamp: 1; }
    .card-footer { flex-direction: column; gap: 8px; text-align: center; }
    .price-text, .action-btn { width: 100%; display: block; }
}

