/**
 * AITECHSKY APPS HUB - DESIGN SYSTEM & STYLES
 * Dark Obsidian Theme, High-End Card Architecture, Ambient Backdrops
 */

:root {
    --bg-main: #070a12;
    --bg-surface: #0e1422;
    --bg-surface-elevated: #151d30;
    --bg-surface-hover: #1c2740;
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    
    --text-main: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --brand-primary: #f97316;
    --brand-primary-hover: #ea580c;
    --brand-amber: #f59e0b;
    --brand-purple: #a855f7;
    --brand-emerald: #10b981;
    --brand-rose: #f43f5e;
    --brand-cyan: #06b6d4;
    --brand-blue: #3b82f6;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
    --shadow-hover: 0 12px 30px -4px rgba(0, 0, 0, 0.65);
    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

html {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Backdrop Glows */
.glow-backdrop {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.18;
}

.glow-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #f97316, transparent 70%);
    top: -150px;
    left: 20%;
}

.glow-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #38bdf8, transparent 70%);
    bottom: 50px;
    right: 10%;
}

.hub-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    position: relative;
    z-index: 1;
}

/* Header */
.hub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 3.5rem;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.35);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
}

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

.brand-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.header-link:hover {
    color: #ffffff;
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.08);
}

.system-status-indicator {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.2);
    padding: 5px 12px;
    border-radius: var(--radius-full);
}

.status-dot-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px #34d399;
    animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* Hero Section */
.hub-hero {
    text-align: center;
    max-width: 820px;
    margin: 0 auto 3.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    margin-bottom: 1.25rem;
}

.hub-hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #ffffff;
    margin-bottom: 1rem;
}

.hero-subtext {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 680px;
    margin: 0 auto 2.5rem;
}

/* Search Bar & Category Filter */
.hub-search-bar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    max-width: 640px;
    margin: 0 auto;
}

.search-input-box {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-input-box svg {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-box input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 0.95rem 5.5rem 0.95rem 3rem;
    color: #ffffff;
    font-size: 0.95rem;
    font-family: inherit;
    box-shadow: var(--shadow-card);
    transition: all 0.2s ease;
}

.search-input-box input:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25), var(--shadow-hover);
    background: var(--bg-surface-elevated);
}

.search-badge-count {
    position: absolute;
    right: 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.category-filter-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.filter-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-pill:hover {
    color: #ffffff;
    border-color: var(--border-hover);
    background: rgba(255, 255, 255, 0.08);
}

.filter-pill.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.35);
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.5rem;
}

.app-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.25s ease;
}

.app-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    background: var(--bg-surface-elevated);
    box-shadow: var(--shadow-hover);
}

.app-card:hover::before {
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-amber));
}

.app-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

/* Icon Wrap */
.app-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.icon-orange {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(234, 88, 12, 0.35) 100%);
    color: #fb923c;
    border-color: rgba(249, 115, 22, 0.3);
}

.icon-amber {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.35) 100%);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.3);
}

.icon-purple {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(147, 51, 234, 0.35) 100%);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.3);
}

.icon-emerald {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.35) 100%);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.3);
}

.icon-rose {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.2) 0%, rgba(225, 29, 72, 0.35) 100%);
    color: #fda4af;
    border-color: rgba(244, 63, 94, 0.3);
}

.icon-cyan {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2) 0%, rgba(8, 145, 178, 0.35) 100%);
    color: #67e8f9;
    border-color: rgba(6, 182, 212, 0.3);
}

.app-badge-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.app-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.badge-primary { background: rgba(249, 115, 22, 0.15); color: #fb923c; border: 1px solid rgba(249, 115, 22, 0.3); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: #fda4af; border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-cyan { background: rgba(6, 182, 212, 0.15); color: #67e8f9; border: 1px solid rgba(6, 182, 212, 0.3); }

.app-status-live {
    font-size: 0.68rem;
    font-weight: 700;
    color: #34d399;
}

/* Card Body */
.app-card-body {
    flex: 1;
    margin-bottom: 1.5rem;
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin-bottom: 0.25rem;
}

.app-tagline {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.app-description {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin-bottom: 1.25rem;
}

.app-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.feat-tag {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

/* Card Footer */
.app-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-subtle);
}

.app-url-pill {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 190px;
}

.btn-launch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.3);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-launch:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.5);
}

/* No Results State */
.no-results-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-surface);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
    max-width: 500px;
    margin: 2rem auto 0;
}

.no-results-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.no-results-state h3 {
    font-size: 1.15rem;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.no-results-state p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.btn-reset-filters {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-reset-filters:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* Footer */
.hub-footer {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.footer-brand-title {
    font-weight: 700;
    color: #ffffff;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: var(--brand-primary);
}

.hidden { display: none !important; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hub-hero h1 {
        font-size: 2.1rem;
    }

    .apps-grid {
        grid-template-columns: 1fr;
    }

    .hub-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .hub-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
