:root {
    --bg-color: #050505;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --accent-primary: #3b82f6; /* Blue */
    --accent-secondary: #8b5cf6; /* Purple */
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(15, 15, 15, 0.7);
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    background-image: linear-gradient(to bottom, rgba(5, 5, 5, 0.8), var(--bg-color)), url('assets/img/hub-hero.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

header {
    text-align: center;
    margin-bottom: 5rem;
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.palette-trigger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.palette-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.kb-shortcut {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

/* Command Palette Overlay */
.palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    padding-top: 15vh;
    transition: all 0.3s ease;
}

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

.palette-container {
    width: 100%;
    max-width: 600px;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.palette-search {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.palette-search input {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    width: 100%;
    outline: none;
}

.palette-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.5rem;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.result-item i {
    width: 20px;
    height: 20px;
}

.result-item:hover, .result-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.kb-shortcut-small {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-btn.active {
    color: var(--accent-primary);
}

.lang-divider {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

header p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 2.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, var(--accent-primary), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card:hover::before {
    opacity: 0.1;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border: 1px solid var(--card-border);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.launch-btn {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.launch-btn i {
    transition: transform 0.3s ease;
}

.card:hover .launch-btn i {
    transform: translateX(4px);
}

/* Background Decorations */
.bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-primary), transparent 70%);
    filter: blur(150px);
    opacity: 0.1;
    border-radius: 50%;
}

.blob-1 { top: -200px; right: -200px; }
.blob-2 { bottom: -200px; left: -200px; background: radial-gradient(circle, var(--accent-secondary), transparent 70%); }

/* Status Bar */
.status-bar {
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 2rem;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.status-group {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-family: inherit;
    color: var(--text-secondary);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.pulse-dot.online { background: #10b981; }
.pulse-dot.offline { background: #ef4444; }
.pulse-dot.warning { background: #f59e0b; }

.pulse-dot.animated {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

.pwa-install-banner {
    position: fixed;
    bottom: 4rem;
    right: 2rem;
    z-index: 2000;
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    max-width: 60px;
    height: 60px;
}

.pwa-install-banner:not(.collapsed) {
    max-width: 500px;
    width: auto;
    padding-right: 1rem;
}

.pwa-install-banner.hidden {
    transform: translateY(150%);
    opacity: 0;
}

.pwa-toggle {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    border: none;
    color: white;
    cursor: pointer;
    flex-shrink: 0;
    transition: 0.3s;
}

.pwa-install-banner:not(.collapsed) .pwa-toggle {
    background: transparent;
    color: var(--accent-primary);
}

.pwa-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
    transition-delay: 0.1s;
    flex: 1;
}

.pwa-install-banner:not(.collapsed) .pwa-content {
    opacity: 1;
}

.pwa-text {
    flex: 1;
    min-width: 0;
    padding-right: 1rem;
}

.pwa-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
}

.pwa-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.pwa-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: white;
    color: black;
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
}

.pwa-install-btn:hover {
    transform: scale(1.05);
}

.pwa-close {
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
}

.pwa-close:hover {
    background: rgba(255,0,0,0.2);
    color: white;
}

.nav-header { 
    display: flex; 
    gap: 1.5rem; 
    align-items: center; 
}

.workspace-link {
    display: flex;
    align-items: center;
    border-left: 1px solid var(--border-color);
    padding-left: 1.5rem;
}

.ws-btn {
    background: rgba(255,255,255,0.05);
    border: 1px dashed var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: 0.3s;
}

.ws-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-style: solid;
}

.ws-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #10b981;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

/* Loader Screen Styles */
.loader-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.loader-logo {
    width: 280px;
    height: auto;
    animation: fadeInLogo 1s ease-out forwards;
}

.loader-bar-container {
    width: 250px;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.loader-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    animation: loaderProgress 2.5s cubic-bezier(0.65, 0.05, 0.36, 1) forwards;
}

@keyframes loaderProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

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

.loader-screen.hidden {
    opacity: 0;
    visibility: hidden;
}
