:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass: rgba(30, 41, 59, 0.7);
    --border: rgba(255, 255, 255, 0.1);
    --radius-lg: 1.5rem;
    --radius-md: 1rem;
    --radius-sm: 0.5rem;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-darker);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-dark);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    z-index: 10;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.5rem;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.main-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.nav-item:hover, .nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent);
}

.nav-item i {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.05), transparent);
}

.top-bar {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 5;
}

.search-container {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
}

.search-container input {
    background: none;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
}

.top-actions {
    display: flex;
    gap: 1rem;
}

.btn-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--border);
    transform: translateY(-2px);
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* Hero Section */
.hero {
    height: 350px;
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.8)), url('https://images.unsplash.com/photo-1544197150-b99a580bb7a8?auto=format&fit=crop&w=1200&q=80');
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: flex-end;
    padding: 3rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(15, 23, 42, 1), transparent);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--accent);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
}

.btn-primary {
    padding: 0.8rem 2rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.btn-secondary {
    padding: 0.8rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

/* Branding */
.brand-info {
    display: flex;
    flex-direction: column;
}

.sub-brand {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
}

.by-creatoz {
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Category Pills */
.category-pills {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
}

.pill {
    padding: 0.6rem 1.5rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-main);
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pill:hover {
    background: var(--border);
}

.pill.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Auth Modal Refinements */
#auth-modal .modal-content {
    transition: all 0.3s ease;
}

#auth-modal a:hover {
    text-decoration: underline;
}

#auth-status {
    font-weight: 500;
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Survey Styles */
.survey-progress {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 6px;
    background: var(--bg-darker);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#step-indicator {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.survey-step h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.survey-step .form-control {
    margin-bottom: 1rem;
}

.survey-step {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Forms & Auth Design System */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.form-control {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.submit-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.4);
    filter: brightness(1.1);
}

.submit-btn:active {
    transform: translateY(0);
}

.social-auth {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.btn-social {
    width: 100%;
    padding: 0.85rem;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-social:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.auth-divider span {
    padding: 0 1rem;
}

/* App Sections */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.view-all {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.app-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.app-card:hover {
    transform: translateY(-10px);
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--accent);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
}

.app-card img {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 1rem;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.app-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-card .developer {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.app-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-main);
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rating i {
    color: #fbbf24;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.9);
    backdrop-filter: blur(15px);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-dark);
    width: 90%;
    max-width: 800px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    position: relative;
    padding: 3rem;
    max-height: 90vh;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
}

/* Loader */
.section-loader {
    display: flex;
    justify-content: center;
    padding: 4rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
