/* ==========================================================
   SAWFISH APP STORE — STYLE SYSTEM
   Dark / Modern / Apple App Store Inspired / PWA-Optimized
   Version: 2.0.0
   Author: Eric Zhu / Sawfish Developer Group
   =========================================================== */

/* -------------------- CSS RESET -------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
                 "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #0b0d10;
    color: #e8e8ea;
    line-height: 1.5;
    overflow-x: hidden;
}

html, body {
    height: 100%;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

/* -------------------- CSS VARIABLES -------------------- */
:root {
    /* Core Colors */
    --bg-main: #0b0d10;
    --bg-secondary: #14171c;
    --bg-tertiary: #1b1f26;
    --bg-elevated: #1f2430;
    --bg-surface: #252a33;
    --bg-elevated-blue: rgba(77, 163, 255, 0.08);
    
    /* Accent Colors */
    --accent-primary: #4da3ff;
    --accent-secondary: #6bb3ff;
    --accent-soft: rgba(77, 163, 255, 0.12);
    --accent-glow: rgba(77, 163, 255, 0.25);
    
    /* Text Colors */
    --text-primary: #e8e8ea;
    --text-secondary: #9aa0aa;
    --text-tertiary: #6b7280;
    --text-inverse: #0b0d10;
    
    /* Status Colors */
    --success: #34d399;
    --warning: #fbbf24;
    --error: #f87171;
    --info: #60a5fa;
    --developer-accent: #a78bfa;
    
    /* Border Colors */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    --border-medium: rgba(255, 255, 255, 0.15);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(77, 163, 255, 0.15);
    --shadow-developer: 0 0 20px rgba(167, 139, 250, 0.2);
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Sidebar Width */
    --sidebar-width: 280px;
}

/* -------------------- UTILITY CLASSES -------------------- */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.muted {
    color: var(--text-secondary);
}

.text-accent {
    color: var(--accent-primary);
}

/* Loading State */
.loading .content {
    opacity: 0;
}

.loaded .content {
    opacity: 1;
    transition: opacity var(--transition-normal);
}

/* ==========================================================
   INSTALLATION SCREEN
========================================================== */
[data-screen="install"] {
    min-height: 100vh;
    padding: var(--spacing-xl) var(--spacing-lg);
    background: linear-gradient(180deg, #0f1217 0%, #0b0d10 100%);
}

.install-header {
    text-align: center;
    padding: var(--spacing-xl) 0;
}

.install-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
}

.sawfish-logo {
    width: 100%;
    height: 100%;
}

.install-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 400px;
    margin: 0 auto;
}

.install-content {
    max-width: 700px;
    margin: 0 auto;
}

.install-content section {
    margin: var(--spacing-2xl) 0;
}

.install-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.install-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--spacing-md);
}

.install-content p:last-child {
    margin-bottom: 0;
}

/* Install Instructions */
.instruction-step {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.instruction-step:last-child {
    border-bottom: none;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.step-content strong {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.step-content p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Benefit Grid */
.benefit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.benefit-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.benefit-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.benefit-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.benefit-icon svg {
    width: 24px;
    height: 24px;
}

.benefit-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.benefit-card p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Final Note */
.note-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.note-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--accent-primary);
}

.note-card ul {
    list-style: disc;
    padding-left: var(--spacing-lg);
}

.note-card li {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
}

/* Install Footer */
.install-footer {
    text-align: center;
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-2xl);
    border-top: 1px solid var(--border-subtle);
}

.install-footer p {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.version-info {
    margin-top: var(--spacing-sm);
}

/* ==========================================================
   APP HEADER
========================================================== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 13, 16, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    max-width: 1400px;
    margin: 0 auto;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* PWA Banner */
.pwa-banner {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm) var(--spacing-md);
}

.pwa-banner-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.pwa-badge {
    background: linear-gradient(135deg, var(--accent-primary) 0%, #3d8ce8 100%);
    color: var(--text-inverse);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.pwa-banner-text {
    display: flex;
    flex-direction: column;
}

.pwa-banner-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pwa-banner-sub {
    font-size: 0.7rem;
    color: var(--text-tertiary);
}

.pwa-banner-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: var(--accent-soft);
    color: var(--accent-primary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.pwa-banner-btn:hover {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

.btn-icon svg {
    width: 14px;
    height: 14px;
}

/* ==========================================================
   SIDEBAR NAVIGATION
========================================================== */
.sidebar-nav {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    z-index: 90;
    transition: transform var(--transition-normal);
    overflow-y: auto;
}

.sidebar-content {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
}

.sawfish-icon {
    width: 100%;
    height: 100%;
}

.sidebar-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.nav-list {
    flex: 1;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: var(--spacing-xs);
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

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

/* Developer Access Section */
.developer-access-section {
    padding: var(--spacing-sm) var(--spacing-md);
}

.developer-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
}

.developer-indicator.hidden {
    display: none;
}

.developer-indicator-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #8b5cf6;
}

.developer-indicator-icon svg {
    width: 18px;
    height: 18px;
}

.developer-indicator-text {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 600;
    color: #a78bfa;
}

.exit-developer-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(139, 92, 246, 0.2);
    border: none;
    border-radius: var(--radius-sm);
    color: #a78bfa;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.exit-developer-btn:hover {
    background: rgba(139, 92, 246, 0.4);
    color: #c4b5fd;
}

.exit-developer-btn svg {
    width: 14px;
    height: 14px;
}

.developer-login-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.developer-login-btn:hover {
    background: var(--bg-surface);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--text-primary);
}

.developer-login-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.developer-status-text {
    font-size: 0.85rem;
    font-weight: 500;
}

.user-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* User Profile in Sidebar */
.user-profile-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-top: var(--spacing-sm);
    border: 1px solid var(--border-subtle);
}

.user-profile-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.user-profile-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.user-profile-btn.logged-in .user-avatar-small {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

/* Developer Login Button */
.developer-login-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-top: var(--spacing-sm);
    border: 1px solid var(--border-subtle);
}

.developer-login-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.developer-login-btn.logged-in {
    background: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.3);
    color: var(--developer-accent);
}

.developer-login-btn.logged-in:hover {
    background: rgba(167, 139, 250, 0.15);
    border-color: rgba(167, 139, 250, 0.5);
}

.developer-login-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.developer-status-text {
    flex: 1;
    text-align: left;
}

/* Developer Nav Item - Hidden by default */
.developer-nav-item {
    display: none;
}

.developer-mode-active .developer-nav-item {
    display: block;
}

/* Developer Login Required Section */
.developer-login-required {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    padding: var(--spacing-xl);
}

.developer-login-prompt {
    text-align: center;
    max-width: 400px;
    padding: var(--spacing-xl);
    background: rgba(167, 139, 250, 0.08);
    border: 2px dashed rgba(167, 139, 250, 0.3);
    border-radius: var(--radius-lg);
}

.developer-login-prompt .prompt-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    background: rgba(139, 92, 246, 0.15);
    border-radius: 50%;
}

.developer-login-prompt .prompt-icon svg {
    width: 40px;
    height: 40px;
    color: #8b5cf6;
}

.developer-login-prompt h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.developer-login-prompt p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

.developer-login-prompt .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.developer-login-prompt .btn-primary:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.developer-login-prompt .btn-primary svg {
    width: 20px;
    height: 20px;
}

/* Developer Tools Page Notice */
.developer-notice {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    background: rgba(167, 139, 250, 0.1);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.developer-notice .notice-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(167, 139, 250, 0.2);
    color: var(--developer-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.developer-notice .notice-icon svg {
    width: 20px;
    height: 20px;
}

.developer-notice .notice-content h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--developer-accent);
}

.developer-notice .notice-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ==========================================================
   RE-GUEST BANNER STYLING
========================================================== */
.reguest-banner {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-sm);
}

.reguest-banner svg {
    width: 16px;
    height: 16px;
    color: var(--warning);
    flex-shrink: 0;
}

.reguest-banner span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--warning);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-reguest-banner {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    left: auto;
    margin-top: 0;
    z-index: 10;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(251, 191, 36, 0.9);
    border: none;
}

.featured-reguest-banner svg {
    width: 14px;
    height: 14px;
}

.featured-reguest-banner span {
    font-size: 0.65rem;
    color: #000;
}

.featured-card {
    position: relative;
    z-index: 1;
}

/* ==========================================================
   MAIN CONTENT
========================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    padding: var(--spacing-lg);
    min-height: calc(100vh - 60px);
}

/* Page containers */
.page {
    display: none;
    animation: fadeIn var(--transition-normal);
}

.page.visible {
    display: block;
}

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

/* ==========================================================
   HOME PAGE
========================================================== */
.home-hero {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
    text-align: center;
}

.hero-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto var(--spacing-lg);
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

.hero-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.hero-btn svg {
    width: 18px;
    height: 18px;
}

.hero-btn.primary {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

.hero-btn.primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.hero-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.hero-btn.secondary:hover {
    background: var(--bg-surface);
    border-color: var(--border-medium);
}

/* Quick Access Section */
.quick-access h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
}

/* ==========================================================
   CARD GRID SYSTEM
========================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

/* App Card */
.app-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.app-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
    background: var(--bg-tertiary);
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.card-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.stars {
    color: #fbbf24;
    font-size: 0.8rem;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    max-width: 100%;
}

.rating-value {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ==========================================================
   NUMERIC RATING BADGE SYSTEM
========================================================== */

/* Numeric Rating Badge */
.rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 24px;
    padding: 0 8px;
    background: var(--accent-soft);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
}

.rating-badge.high {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
}

.rating-badge.medium {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
}

.rating-badge.low {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}

.rating-badge.na {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.rating-badge .rating-decimal {
    font-size: 0.7rem;
    opacity: 0.8;
    margin-left: 1px;
}

/* Rating value text next to badge */
.rating-with-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.rating-count-text {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-left: var(--spacing-xs);
}

/* ==========================================================
   STAR RATING SYSTEM WITH HALF-STARS
========================================================== */

/* Star Rating Container */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: inherit;
    color: #fbbf24;
    letter-spacing: 1px;
}

/* Individual Star */
.star {
    position: relative;
    display: inline-block;
    width: 1em;
    height: 1em;
    font-size: inherit;
}

.star::before {
    content: '★';
    position: relative;
    z-index: 1;
}

/* Half Star Styling */
.star.half::before {
    content: '★';
    background: linear-gradient(90deg, #fbbf24 50%, transparent 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #fbbf24;
}

/* Empty Star */
.star.empty::before {
    color: var(--bg-surface);
}

/* Full Star */
.star.filled::before {
    color: #fbbf24;
}

/* Star size variations */
.star-rating.small {
    font-size: 0.8rem;
}

.star-rating.medium {
    font-size: 1rem;
}

.star-rating.large {
    font-size: 1.5rem;
}

/* Rating value text */
.rating-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: var(--spacing-sm);
}

.rating-na {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-style: italic;
}

/* ==========================================================
   SEARCH TAB STYLES
========================================================== */
.search-container {
    margin-bottom: var(--spacing-xl);
}

.search-input-wrapper {
    position: relative;
    max-width: 500px;
    margin: 0 auto var(--spacing-lg);
}

.search-input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    width: 20px;
    height: 20px;
}

.search-results-count {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
}

.search-results-count span {
    color: var(--accent-primary);
    font-weight: 600;
}

.search-highlight {
    background: rgba(77, 163, 255, 0.2);
    color: var(--accent-primary);
    padding: 0 2px;
    border-radius: 2px;
}

/* Search categories filter */
.search-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.search-category-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.search-category-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.search-category-btn.active {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

/* No results state */
.search-no-results {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--text-secondary);
}

.search-no-results svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--spacing-md);
    color: var(--text-tertiary);
}

.search-no-results h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

/* ==========================================================
   FEATURED PAGE
========================================================== */
.featured-hero {
    margin-bottom: var(--spacing-xl);
}

.featured-card {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.featured-badge {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: var(--text-inverse);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
}

.featured-card.highlight {
    position: relative;
}

.featured-card.highlight .featured-icon {
    width: 140px;
    height: 140px;
}

.featured-icon {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-lg);
}

.featured-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.featured-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.featured-info p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.featured-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--accent-primary);
    color: var(--text-inverse);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.featured-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.featured-btn svg {
    width: 16px;
    height: 16px;
}

.card-section {
    margin-bottom: var(--spacing-xl);
}

.card-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
}

/* ==========================================================
   FEATURED SECTIONS (Games & OS Pages)
========================================================== */
.featured-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

.featured-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.featured-card:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.featured-card img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
}

.featured-content h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.featured-content p {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* ==========================================================
   GAMES PAGE
========================================================== */
.page-header {
    margin-bottom: var(--spacing-xl);
}

.page-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.page-header p {
    color: var(--text-secondary);
    max-width: 600px;
}

/* Game Categories */
.game-categories {
    margin-bottom: var(--spacing-lg);
}

.category-tabs {
    display: flex;
    gap: var(--spacing-sm);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
}

.category-tab {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.category-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.category-tab.active {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

/* ==========================================================
   SOCIAL PAGE
========================================================== */
.social-features {
    margin-top: var(--spacing-xl);
}

.social-features h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--spacing-md);
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.feature-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ==========================================================
   MISCELLANEOUS PAGE
========================================================== */
.misc-notice {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.misc-notice .notice-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.misc-notice .notice-icon svg {
    width: 20px;
    height: 20px;
}

.misc-notice .notice-content h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.misc-notice .notice-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ==========================================================
   OS PAGE
========================================================== */
.os-notice {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.notice-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notice-icon svg {
    width: 20px;
    height: 20px;
}

.notice-content h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.notice-content p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ==========================================================
   CHANGELOG PAGE
========================================================== */
.changelog-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.meta-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-primary);
}

/* Changelog Timeline */
.changelog-timeline {
    position: relative;
    padding-left: var(--spacing-xl);
}

.changelog-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-light);
}

.changelog-entry {
    position: relative;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--border-subtle);
}

.changelog-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.changelog-entry::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--spacing-xl) + 4px);
    top: 8px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid var(--bg-main);
}

.entry-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.entry-version {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.entry-date {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.entry-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
}

.entry-badge.major {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.entry-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    margin-top: var(--spacing-md);
}

.entry-content h4:first-child {
    margin-top: 0;
}

.entry-content ul {
    list-style: none;
}

.entry-content li {
    position: relative;
    padding-left: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.entry-content li::before {
    content: '•';
    position: absolute;
    left: 8px;
    color: var(--accent-primary);
}

.entry-content li:last-child {
    margin-bottom: 0;
}

/* ==========================================================
   EXPANDED APP VIEW
========================================================== */
.expanded-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    opacity: 1;
    transition: opacity var(--transition-normal);
}

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

.expanded-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.expanded-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--transition-normal);
    border: 1px solid var(--border-light);
}

.expanded-header-bar {
    position: absolute;
    top: 0;
    right: 0;
    padding: var(--spacing-md);
    z-index: 10;
}

.expanded-close-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.expanded-close-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.expanded-close-btn svg {
    width: 20px;
    height: 20px;
}

.expanded-content-wrapper {
    overflow-y: auto;
    max-height: 90vh;
}

/* Expanded App Header */
.expanded-header {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-secondary) 100%);
    padding: var(--spacing-xl);
    display: flex;
    gap: var(--spacing-lg);
    align-items: flex-start;
}

.expanded-icon {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-lg);
}

.expanded-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.expanded-info {
    flex: 1;
}

.expanded-info h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.expanded-info p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.expanded-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.open-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--accent-primary);
    color: var(--text-inverse);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.open-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.open-btn svg {
    width: 16px;
    height: 16px;
}

/* Expanded Rating */
.expanded-rating {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.rating-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rating-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rating-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.rating-stars .star {
    font-size: 1rem;
}

.rating-count {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Rating distribution bars */
.rating-bars {
    margin-top: var(--spacing-md);
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.rating-bar-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    width: 20px;
}

.rating-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: var(--radius-full);
}

.rating-bar-count {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    width: 30px;
    text-align: right;
}

/* Expanded Body */
.expanded-body {
    padding: var(--spacing-xl);
}

.expanded-section {
    margin-bottom: var(--spacing-xl);
}

.expanded-section:last-child {
    margin-bottom: 0;
}

.expanded-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.expanded-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Screenshot Gallery */
.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.screenshot-item {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    background: var(--bg-tertiary);
}

.screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

/* Expanded Reviews */
.reviews-section {
    border-top: 1px solid var(--border-subtle);
    padding-top: var(--spacing-xl);
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.reviews-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.reviews-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.review-card {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.review-author {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.review-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

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

.review-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.review-stars {
    color: #fbbf24;
    font-size: 0.85rem;
}

.review-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.review-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-subtle);
}

.review-action-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.review-action-btn:hover {
    color: var(--accent-primary);
}

.developer-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 2px 8px;
    background: rgba(167, 139, 250, 0.15);
    color: var(--developer-accent);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: var(--spacing-sm);
}

/* Review Form */
.review-form {
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.review-form h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.review-form textarea {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
    min-height: 80px;
    margin-bottom: var(--spacing-md);
}

.review-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.review-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--accent-primary);
    color: var(--text-inverse);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.review-submit-btn:hover {
    background: var(--accent-secondary);
}

/* Star Rating Input */
.star-rating-input {
    display: flex;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.star-rating-input .star-btn {
    background: none;
    border: none;
    color: var(--bg-surface);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
    padding: 0;
}

.star-rating-input .star-btn:hover,
.star-rating-input .star-btn.active {
    color: #fbbf24;
}

/* ==========================================================
   MODAL SYSTEM
========================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    opacity: 1;
    transition: opacity var(--transition-normal);
}

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

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--transition-normal);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

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

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modal-body {
    padding: var(--spacing-lg);
    overflow-y: auto;
    flex: 1;
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
}

.modal-cancel-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.modal-cancel-btn:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* ==========================================================
   WELCOME MODAL
========================================================== */
#welcome-modal .modal-container {
    max-width: 550px;
}

.modal-scroll-content {
    padding-right: var(--spacing-sm);
}

.guideline-section {
    margin-bottom: var(--spacing-lg);
}

.guideline-section:last-child {
    margin-bottom: 0;
}

.guideline-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--accent-primary);
}

.guideline-section p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.scroll-arrow {
    width: 20px;
    height: 20px;
    border-right: 2px solid var(--text-tertiary);
    border-bottom: 2px solid var(--text-tertiary);
    transform: rotate(45deg);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: rotate(45deg) translateY(0);
    }
    40% {
        transform: rotate(45deg) translateY(6px);
    }
    60% {
        transform: rotate(45deg) translateY(3px);
    }
}

.modal-returning-content {
    text-align: center;
    padding: var(--spacing-xl);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-subtle);
}

.ack-checkbox-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    cursor: pointer;
}

.ack-checkbox-row input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.ack-checkbox-row span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.modal-continue-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--accent-primary);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.modal-continue-btn:hover:not(:disabled) {
    background: var(--accent-secondary);
}

.modal-continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.modal-continue-btn svg {
    width: 18px;
    height: 18px;
}

/* ==========================================================
   DEVELOPER LOGIN MODAL
========================================================== */
.developer-login-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    opacity: 1;
    transition: opacity var(--transition-normal);
}

.developer-login-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.developer-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.developer-modal-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: slideUp var(--transition-normal);
    border: 1px solid var(--border-light);
}

.developer-modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.developer-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(167, 139, 250, 0.15);
    color: var(--developer-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.developer-modal-icon svg {
    width: 24px;
    height: 24px;
}

.developer-modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.developer-modal-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.developer-modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.developer-modal-close:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.developer-modal-close svg {
    width: 18px;
    height: 18px;
}

.developer-modal-body {
    padding: var(--spacing-lg);
}

.developer-input-group {
    margin-bottom: var(--spacing-md);
}

.developer-input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.developer-input-group input {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all var(--transition-fast);
}

.developer-input-group input:focus {
    outline: none;
    border-color: var(--developer-accent);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}

.developer-input-group input::placeholder {
    color: var(--text-tertiary);
}

/* Password field styling - dark themed with masked input */
.developer-input-group input[type="password"] {
    background: #1e293b;
    border-color: var(--border-medium);
    letter-spacing: 2px;
}

.developer-input-group input[type="password"]::placeholder {
    letter-spacing: normal;
}

.developer-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, var(--developer-accent) 0%, #8b5cf6 100%);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    margin-top: var(--spacing-md);
}

.developer-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-developer);
}

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

.developer-error-message {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--error);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: var(--spacing-md);
    display: none;
}

.developer-error-message.visible {
    display: block;
}

/* ==========================================================
   PROFILE MODAL
========================================================== */
.profile-modal .modal-container {
    max-width: 600px;
}

/* User Profile Modal (for viewing other users) */
.user-profile-modal .modal-container {
    max-width: 500px;
}

.user-profile-modal .modal-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.user-profile-modal .profile-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--accent-soft);
    flex-shrink: 0;
}

.user-profile-modal .profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-profile-modal .profile-avatar-large .avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    font-size: 2rem;
    font-weight: 600;
}

.user-profile-modal .user-profile-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.user-profile-modal .user-profile-info .user-bio {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-sm);
}

.user-profile-modal .user-profile-info .user-achievements-display {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
    margin-top: var(--spacing-sm);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
}

.profile-avatar-large {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.profile-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.profile-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: var(--spacing-xs);
}

.profile-status {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 2px 8px;
    background: var(--accent-soft);
    color: var(--accent-primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.profile-status.developer {
    background: rgba(167, 139, 250, 0.15);
    color: var(--developer-accent);
}

.profile-body {
    padding: var(--spacing-md);
}

.profile-section {
    margin-bottom: var(--spacing-sm);
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Profile avatar upload */
.avatar-upload {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.avatar-upload-preview {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2rem;
    overflow: hidden;
}

.avatar-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.avatar-upload-btn:hover {
    background: var(--bg-surface);
    border-color: var(--border-light);
}

.avatar-upload input[type="file"] {
    display: none;
}

/* Profile form */
.profile-form .form-group {
    margin-bottom: var(--spacing-sm);
}

.profile-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
}

.profile-form input[type="text"],
.profile-form input[type="email"] {
    width: 100%;
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.profile-form input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Profile actions */
.profile-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.profile-btn {
    flex: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.profile-btn.primary {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

.profile-btn.primary:hover {
    background: var(--accent-secondary);
}

.profile-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.profile-btn.secondary:hover {
    background: var(--bg-surface);
}

/* ==========================================================
   AUTH MODAL (Login/Signup)
========================================================== */
.auth-modal .modal-container {
    max-width: 420px;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
}

.auth-tab {
    flex: 1;
    padding: var(--spacing-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    border-bottom: 2px solid transparent;
}

.auth-tab:hover {
    color: var(--text-primary);
}

.auth-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.auth-form {
    padding: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.styled-input {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.styled-input::placeholder {
    color: var(--text-tertiary);
}

.styled-input:hover {
    border-color: var(--border-medium);
}

.styled-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

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

.auth-submit-btn {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--accent-primary);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    transition: all var(--transition-fast);
    margin-top: var(--spacing-md);
}

.auth-submit-btn:hover:not(:disabled) {
    background: var(--accent-secondary);
}

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

.auth-footer {
    text-align: center;
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.auth-footer a {
    color: var(--accent-primary);
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-error {
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.3);
    color: var(--error);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: var(--spacing-md);
    display: none;
}

.auth-error.visible {
    display: block;
}

.auth-success {
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: var(--success);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: var(--spacing-md);
    display: none;
}

.auth-success.visible {
    display: block;
}

/* ==========================================================
   DEVELOPER DASHBOARD STYLES
========================================================== */
.developer-section {
    margin-bottom: var(--spacing-xl);
}

.developer-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--developer-accent);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.developer-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.developer-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    text-align: center;
}

.developer-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--developer-accent);
    margin-bottom: var(--spacing-xs);
}

.developer-stat-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.developer-table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.developer-table {
    width: 100%;
    border-collapse: collapse;
}

.developer-table th,
.developer-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.developer-table th {
    background: var(--bg-tertiary);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.developer-table td {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.developer-table tr:last-child td {
    border-bottom: none;
}

.developer-table tr:hover td {
    background: var(--bg-tertiary);
}

.developer-action-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.developer-action-btn.edit {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.developer-action-btn.edit:hover {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

.developer-action-btn.delete {
    background: rgba(248, 113, 113, 0.1);
    color: var(--error);
}

.developer-action-btn.delete:hover {
    background: var(--error);
    color: var(--text-inverse);
}

/* ==========================================================
   NOTIFICATION TOAST
========================================================== */
.notification-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-primary);
    color: var(--text-inverse);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 2000;
    animation: slideUp 0.3s ease;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ==========================================================
   SCROLLBARS
========================================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================
   RESPONSIVE DESIGN
========================================================== */

/* iPad and Tablet - Enhanced Grid Layout */
@media (max-width: 1024px) and (min-width: 769px) {
    :root {
        --sidebar-width: 72px;
    }
    
    .sidebar-header h2,
    .nav-item span,
    .sidebar-footer span,
    .developer-status-text {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: var(--spacing-md);
    }
    
    .nav-item svg {
        width: 24px;
        height: 24px;
    }
    
    .sidebar-header {
        justify-content: center;
        padding: var(--spacing-md) 0;
    }
    
    .main-content {
        margin-left: var(--sidebar-width);
    }
    
    .featured-card {
        flex-direction: column;
        text-align: center;
    }
    
    .developer-login-btn,
    .user-profile-btn {
        justify-content: center;
    }
    
    .featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* iPad specific card grid improvements */
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-md);
    }
    
    .app-card {
        padding: var(--spacing-lg);
    }
    
    .card-icon {
        width: 64px;
        height: 64px;
    }
    
    .card-content h4 {
        font-size: 1.1rem;
    }
    
    .card-desc {
        font-size: 0.9rem;
    }
    
    /* iPad search improvements */
    .search-container {
        max-width: 600px;
        margin: 0 auto var(--spacing-xl);
    }
    
    .search-input {
        font-size: 1.1rem;
        padding: var(--spacing-lg) var(--spacing-lg) var(--spacing-lg) 52px;
    }
    
    /* iPad featured sections */
    .featured-section {
        padding: var(--spacing-xl);
    }
    
    .featured-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .featured-card {
        padding: var(--spacing-lg);
    }
    
    .featured-card img {
        width: 64px;
        height: 64px;
    }
    
    .featured-content h4 {
        font-size: 0.95rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0;
    }
    
    .sidebar-nav {
        transform: translateX(-100%);
    }
    
    .sidebar-nav.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: var(--spacing-md);
    }
    
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .app-card {
        padding: var(--spacing-sm);
    }
    
    .card-icon {
        width: 48px;
        height: 48px;
    }
    
    .card-content h4 {
        font-size: 0.9rem;
    }
    
    .card-desc {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }
    
    .home-hero {
        padding: var(--spacing-lg);
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .featured-card {
        padding: var(--spacing-lg);
    }
    
    .featured-icon {
        width: 80px;
        height: 80px;
    }
    
    .featured-info h3 {
        font-size: 1.25rem;
    }
    
    .page-header h2 {
        font-size: 1.5rem;
    }
    
    .benefit-grid {
        grid-template-columns: 1fr;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .expanded-container {
        max-height: 100vh;
        max-width: 100vw;
        border-radius: 0;
    }
    
    .screenshot-gallery {
        grid-template-columns: 1fr;
    }
    
    .expanded-actions {
        flex-direction: column;
    }
    
    .rating-bars {
        display: none;
    }
    
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .developer-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .developer-table-container {
        overflow-x: auto;
    }
    
    .developer-modal-container {
        max-width: 100%;
    }
    
    /* Search mobile styles */
    .search-container {
        margin-bottom: var(--spacing-lg);
    }
    
    .search-input {
        font-size: 0.95rem;
    }
    
    .search-categories {
        gap: var(--spacing-xs);
    }
    
    .search-category-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .app-card {
        padding: var(--spacing-sm);
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
        margin-bottom: var(--spacing-xs);
    }
    
    .card-content h4 {
        font-size: 0.8rem;
    }
    
    .card-rating {
        display: none;
    }
    
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .developer-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .developer-stat-card {
        padding: var(--spacing-sm);
    }
    
    .developer-stat-value {
        font-size: 1.25rem;
    }
}

/* ==========================================================
   PRINT STYLES
========================================================== */
@media print {
    .sidebar-nav,
    .pwa-banner,
    .expanded-overlay,
    .modal-overlay,
    .notification-toast,
    .developer-login-btn,
    .developer-login-modal,
    .developer-section,
    .profile-modal,
    .auth-modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* ==========================================================
   ACCESSIBILITY
========================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.focus-visible:focus,
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-subtle: rgba(255, 255, 255, 0.3);
        --border-light: rgba(255, 255, 255, 0.5);
    }
}

/* ==========================================================
   OFFLINE TAGS
========================================================== */
.offline-tag {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--text-tertiary);
    color: var(--bg-main);
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    cursor: pointer;
    transition: all 0.2s ease;
}

.offline-tag:hover {
    background: var(--text-secondary);
    transform: scale(1.05);
}

.offline-tag:active {
    transform: scale(0.95);
}

/* ==========================================================
   MINECRAFT RE-GUEST WARNING
========================================================== */
.app-card[data-reguest="true"] {
    border: 2px solid var(--warning);
    position: relative;
}

.app-card[data-reguest="true"]::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid var(--warning);
    border-radius: var(--radius-lg);
    pointer-events: none;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
    }
}

.reguest-warning {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--warning);
    color: var(--bg-main);
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
    animation: blink-warning 1.5s infinite;
}

@keyframes blink-warning {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ==========================================================
   COMMUNITY BOARD STYLES
========================================================== */
.community-post-section {
    margin-bottom: var(--spacing-lg);
}

.community-form {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    border: 1px solid var(--border-subtle);
}

.community-form textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.community-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.community-form textarea::placeholder {
    color: var(--text-tertiary);
}

.community-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--spacing-sm);
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* Petition Checkbox Styling */
.petition-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.petition-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--developer-accent);
    cursor: pointer;
}

.petition-label-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--accent-primary);
    color: var(--text-inverse);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

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

.community-posts-section {
    margin-top: var(--spacing-lg);
}

.community-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.community-header-row h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.community-filter {
    display: flex;
    gap: var(--spacing-xs);
}

.filter-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--text-inverse);
}

.community-posts-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.community-post {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    border: 1px solid var(--border-subtle);
    animation: fadeIn 0.3s ease;
}

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

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.post-author-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.post-author-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.post-author-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.post-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.post-badge {
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
}

.post-badge.chat {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.post-badge.petition {
    background: rgba(167, 139, 250, 0.2);
    color: var(--developer-accent);
}

.post-badge.admin {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}

.post-badge.resolved {
    background: rgba(52, 211, 153, 0.15);
    color: var(--success);
}

.community-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(77, 163, 255, 0.3);
    border: 2px solid var(--bg-secondary);
}

.community-post-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(77, 163, 255, 0.3);
    border: 2px solid var(--bg-secondary);
    flex-shrink: 0;
}

.community-post-avatar.admin {
    background: linear-gradient(135deg, var(--error) 0%, #ef4444 100%);
    border-color: rgba(248, 113, 113, 0.3);
}

.community-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.community-author-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.community-author-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 6px;
    background: var(--accent-soft);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.community-author-badge.developer {
    background: rgba(167, 139, 250, 0.15);
    color: var(--developer-accent);
}

.community-author-badge.admin {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}

.community-post-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.community-post-type {
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
}

.community-post-type.chat {
    background: var(--accent-soft);
    color: var(--accent-primary);
}

.community-post-type.petition {
    background: rgba(167, 139, 250, 0.15);
    color: var(--developer-accent);
}

.community-post-type.admin_alert {
    background: rgba(248, 113, 113, 0.15);
    color: var(--error);
}

.post-content {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    word-wrap: break-word;
    padding: var(--spacing-sm) 0;
}

.post-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--border-subtle);
}

.delete-post-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.delete-post-btn:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: var(--error);
    color: var(--error);
}

.resolve-petition-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.resolve-petition-btn:hover {
    background: rgba(52, 211, 153, 0.2);
    border-color: var(--success);
}

.post-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.post-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-author-avatar-default {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-inverse);
    box-shadow: 0 2px 8px rgba(77, 163, 255, 0.3);
    border: 2px solid var(--bg-secondary);
    flex-shrink: 0;
}

.resolved-info {
    margin-top: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(52, 211, 153, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--success);
}

/* Petition specific styling */
.community-post.petition {
    border: 1px solid rgba(167, 139, 250, 0.2);
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.05) 0%, rgba(77, 163, 255, 0.05) 100%);
}

.community-post.petition .community-post-type {
    background: rgba(167, 139, 250, 0.2);
    color: var(--developer-accent);
    font-weight: 700;
}

.petition-signatures {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm);
    background: rgba(167, 139, 250, 0.1);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

.petition-signatures-count {
    font-weight: 700;
    color: var(--developer-accent);
    font-size: 1.1rem;
}

.petition-signatures-label {
    color: var(--text-secondary);
}

.petition-progress-bar {
    margin-top: var(--spacing-sm);
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.petition-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--developer-accent) 0%, var(--accent-primary) 100%);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.community-action-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.community-action-btn.liked {
    color: var(--error);
}

.community-empty {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-light);
}

/* ========== USER SEARCH STYLES ========== */
.community-user-search {
    margin-bottom: var(--spacing-md);
}

.user-search-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.user-search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.user-search-input::placeholder {
    color: var(--text-tertiary);
}

.community-users-section {
    margin-bottom: var(--spacing-lg);
}

.community-users-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 300px;
    overflow-y: auto;
    padding-right: var(--spacing-xs);
}

.community-users-list::-webkit-scrollbar {
    width: 6px;
}

.community-users-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.community-users-list::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

.community-user-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-subtle);
    transition: border-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.community-user-card:hover {
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.community-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
}

.community-user-info {
    flex: 1;
    min-width: 0;
}

.community-user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 2px;
}

.community-user-bio {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================
   CHANGELOG ACTIONS
========================================================== */
.changelog-actions {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    text-align: center;
}

.changelog-actions h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.changelog-actions p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
}

.changelog-actions .btn-primary {
    display: inline-flex;
    gap: var(--spacing-sm);
}

/* ==========================================================
   WARNING MODAL STYLES
========================================================== */
.warning-modal {
    max-width: 450px;
}

.warning-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: rgba(251, 191, 36, 0.1);
    border-bottom: 1px solid rgba(251, 191, 36, 0.2);
}

.warning-icon {
    width: 32px;
    height: 32px;
    color: var(--warning);
    flex-shrink: 0;
}

.warning-header h2 {
    color: var(--warning);
}

.warning-modal .modal-body {
    padding: var(--spacing-lg);
}

.warning-modal .modal-body p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.warning-modal .modal-body ul {
    list-style: disc;
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.warning-modal .modal-body li {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.warning-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

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

/* ==========================================================
   DEVELOPER MODE HIDDEN APPS
========================================================== */

/* Hidden apps that require developer mode */
.app-card.developer-only {
    display: none;
}

.developer-mode-active .app-card.developer-only {
    display: flex;
}

/* Developer mode indicator in sidebar */
.developer-mode-indicator {
    display: none;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(167, 139, 250, 0.15);
    color: var(--developer-accent);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: var(--spacing-sm);
}

.developer-mode-active .developer-mode-indicator {
    display: inline-flex;
}

/* ==========================================================
   DEBUG & HIDDEN CONTENT - Fix for random words bug
========================================================== */

/* Hide any debug or test content that shouldn't be visible */
.debug-content,
.test-content,
.dev-content:not(.developer-mode-active *),
[data-debug],
.dev-debug {
    display: none !important;
}

/* Ensure sidebar has proper z-index to prevent content bleed */
/* Note: .sidebar-nav is defined earlier at lines 460-471 */

/* Ensure modal overlays have higher z-index */
.modal-overlay {
    z-index: 1000;
}

/* Hide any search index or autocomplete suggestions that might leak */
.search-suggestions,
.autocomplete-list,
.suggestions-list {
    display: none;
}

/* ==========================================================
   DEVELOPER-ONLY APPS STYLING
========================================================== */

/* Developer-only app cards have special styling */
.app-card.developer-only {
    display: none;
    border: 1px solid rgba(167, 139, 250, 0.3);
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.05) 0%, rgba(77, 163, 255, 0.05) 100%);
}

.developer-mode-active .app-card.developer-only {
    display: flex;
}

.developer-mode-active .app-card.developer-only:hover {
    border-color: var(--developer-accent);
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.1) 0%, rgba(77, 163, 255, 0.1) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-developer);
}

/* Developer badge for app cards */
.developer-badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: rgba(167, 139, 250, 0.15);
    color: var(--developer-accent);
    border-radius: var(--radius-sm);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: var(--spacing-xs);
}

/* ==========================================================
   END OF STYLES
========================================================== */

/* ========== EXPANDED VIEW STYLING ========== */
.expanded-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    overflow-y: auto;
}

.expanded-overlay.hidden {
    display: none;
}

.expanded-content-wrapper {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-subtle);
}

.expanded-app {
    padding: var(--spacing-xl);
}

.expanded-app-header {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.expanded-app-icon {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.expanded-app-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.expanded-app-info h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.expanded-developer {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-sm);
}

.expanded-app-meta {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.app-category {
    background: var(--accent-soft);
    color: var(--accent-primary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
}

.expanded-summary {
    margin-bottom: var(--spacing-lg);
}

.expanded-summary p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.6;
}

.expanded-description {
    margin-bottom: var(--spacing-lg);
}

.expanded-description h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.expanded-description p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.expanded-screenshots {
    margin-bottom: var(--spacing-lg);
}

.expanded-screenshots h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.screenshot-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.screenshot-item {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

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

.expanded-actions {
    margin-bottom: var(--spacing-lg);
}

.expanded-actions a {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--accent-primary);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-full);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.expanded-actions a:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 163, 255, 0.3);
}

.expanded-actions svg {
    width: 20px;
    height: 20px;
}

.expanded-ratings {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.ratings-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.rating-stats {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.rating-big {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rating-big.na-rating {
    color: var(--text-tertiary);
}

.rating-details {
    color: var(--text-secondary);
}

.rating-count {
    font-size: 0.9rem;
}

.expanded-close-btn {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.expanded-close-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-subtle);
}

.expanded-close-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

/* ========== EXPANDED REVIEWS STYLING ========== */
.expanded-comments {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-subtle);
}

.expanded-comments h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.comment-list {
    margin-bottom: var(--spacing-lg);
}

.comment-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-subtle);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.comment-avatar.developer {
    background: var(--accent-secondary);
}

.comment-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-name {
    font-weight: 600;
    color: var(--text-primary);
}

.developer-badge {
    background: var(--accent-secondary);
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: var(--spacing-sm);
}

.comment-rating {
    color: var(--accent-primary);
    font-weight: 600;
    margin-right: var(--spacing-sm);
}

.comment-date {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.comment-body {
    color: var(--text-secondary);
    line-height: 1.5;
}

.comment-form {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.comment-form h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.comment-form .form-group {
    margin-bottom: var(--spacing-md);
}

.comment-form label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.rating-input {
    display: flex;
    gap: var(--spacing-xs);
}

.rating-num-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-num-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.rating-num-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.comment-form textarea {
    width: 100%;
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 80px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.comment-form button[type="submit"] {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-form button[type="submit"]:hover {
    background: var(--accent-hover);
}

/* ========== DEVELOPER LOGIN STYLING ========== */
.developer-modal {
    max-width: 420px;
}

.developer-login-form {
    padding: var(--spacing-md) 0;
}

.developer-login-form .form-group {
    margin-bottom: var(--spacing-md);
}

.developer-login-form label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.developer-login-form input[type="password"] {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.developer-login-form input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.password-hint {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-style: italic;
}

/* ========== USER ACHIEVEMENTS STYLING ========== */
.user-achievements {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
}

.mini-badge {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: help;
    transition: transform 0.2s ease;
    border: 2px solid var(--accent-primary);
}

.mini-badge:hover {
    transform: scale(1.2);
}

/* Achievement badges in user search results */
.achievement-badge-small {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: help;
    transition: transform 0.2s ease, border-color 0.2s ease;
    border: 1.5px solid var(--accent-primary);
    color: var(--text-primary);
    margin-right: 2px;
}

.achievement-badge-small:hover {
    transform: scale(1.15);
    border-color: var(--accent-secondary);
    background: var(--accent-soft);
}

.achievement-badge-circle {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: help;
    transition: transform 0.2s ease, border-color 0.2s ease;
    border: 2px solid var(--accent-primary);
    color: var(--text-primary);
    margin-right: 4px;
}

.achievement-badge-circle:hover {
    transform: scale(1.15);
    border-color: var(--accent-secondary);
    background: var(--accent-soft);
}

.achievement-more {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-left: var(--spacing-xs);
}

/* Profile bio textarea */
#profile-bio-input {
    width: 100%;
    padding: var(--spacing-sm);
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#profile-bio-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Rating bars in expanded view */
.rating-bars {
    margin-top: var(--spacing-md);
}

.rating-bar-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.rating-bar-label {
    width: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.rating-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.rating-bar-fill {
    height: 100%;
    background: var(--accent-primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.rating-bar-count {
    width: 30px;
    text-align: right;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* ==========================================================
   FAQ SECTION STYLES
========================================================== */
.faq-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.faq-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    transition: background-color var(--transition-fast);
}

.faq-question:hover {
    background: var(--bg-tertiary);
}

.faq-question:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--accent-primary);
}

.faq-icon {
    font-size: 1.25rem;
    color: var(--accent-primary);
    font-weight: bold;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-normal);
    flex-shrink: 0;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 var(--spacing-lg);
    transition: max-height var(--transition-normal), padding var(--transition-normal);
    background: var(--bg-tertiary);
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
}

.faq-answer p {
    margin: 0 0 var(--spacing-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
    margin: var(--spacing-sm) 0;
    padding-left: var(--spacing-xl);
    color: var(--text-secondary);
}

.faq-answer li {
    margin-bottom: var(--spacing-xs);
    line-height: 1.5;
}

.faq-answer strong {
    color: var(--text-primary);
}

/* Mobile FAQ styles */
@media (max-width: 768px) {
    .faq-section {
        gap: var(--spacing-xs);
    }
    
    .faq-question {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: 0.9rem;
    }
    
    .faq-answer {
        padding: 0 var(--spacing-md);
    }
    
    .faq-item.active .faq-answer {
        padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
    }
}
