/*
Theme Name: CUEBES
Theme URI: https://cueb.es
Author: vaic.at
Author URI: https://vaic.at
Description: Social platform with Liquid Glass design. Secure authentication, E2EE messaging, and ecosystem integration.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: Proprietary
License URI: https://vaic.at/license
Text Domain: cuebes
*/

/* ============================================
   CUEBES - Liquid Glass Design System
   ============================================ */

:root {
    /* Brand Colors */
    --cuebes-primary: #6366f1;
    --cuebes-primary-light: #818cf8;
    --cuebes-primary-dark: #4f46e5;
    --cuebes-secondary: #06b6d4;
    --cuebes-secondary-light: #22d3ee;
    --cuebes-accent: #f472b6;
    --cuebes-accent-light: #f9a8d4;

    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.85);
    --text-tertiary: rgba(255, 255, 255, 0.65);
    --text-muted: rgba(255, 255, 255, 0.45);
    --text-inverse: #0f0f23;

    /* Background */
    --bg-void: #000000;
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a3e;
    --bg-tertiary: #0d0d1a;

    /* Liquid Glass System */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-bg-hover: rgba(255, 255, 255, 0.12);
    --glass-bg-active: rgba(255, 255, 255, 0.16);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-border-light: rgba(255, 255, 255, 0.25);
    --glass-border-subtle: rgba(255, 255, 255, 0.1);
    --glass-blur: 20px;
    --glass-blur-heavy: 40px;
    --glass-saturation: 180%;
    --glass-shadow: rgba(0, 0, 0, 0.25);
    --glass-shadow-heavy: rgba(0, 0, 0, 0.4);

    /* Specular Highlights */
    --specular-top: rgba(255, 255, 255, 0.5);
    --specular-edge: rgba(255, 255, 255, 0.3);
    --specular-subtle: rgba(255, 255, 255, 0.1);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --font-display: 'Space Grotesk', var(--font-sans);
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 300;
    --z-toast: 400;
    --z-tooltip: 500;
}

/* ============================================
   Reset & Base
   ============================================ */

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

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

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Animated gradient background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(6, 182, 212, 0.1), transparent),
        radial-gradient(ellipse 50% 30% at 0% 80%, rgba(244, 114, 182, 0.08), transparent);
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--cuebes-primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--cuebes-secondary);
}

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

button {
    font-family: inherit;
    cursor: pointer;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

.gradient-text {
    background: linear-gradient(135deg, var(--cuebes-primary-light), var(--cuebes-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Utility Classes
   ============================================ */

.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;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Text Colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-info { color: var(--info); }

/* ============================================
   Scrollbar Styling
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
}

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

/* ============================================
   Selection
   ============================================ */

::selection {
    background: rgba(99, 102, 241, 0.4);
    color: var(--text-primary);
}

/* ============================================
   Focus States (Accessibility)
   ============================================ */

:focus-visible {
    outline: 2px solid var(--cuebes-primary);
    outline-offset: 2px;
}

/* ============================================
   Reduced Motion
   ============================================ */

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

/* ============================================
   Main Header / Navigation
   ============================================ */

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    z-index: var(--z-sticky);
    border-radius: 0;
    overflow: visible; /* Allow dropdown to extend beyond header */
}

.main-header::before {
    border-radius: 0;
}

.main-header::after {
    display: none;
}

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

/* Logo */
.header-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    flex-shrink: 0;
}

.header-logo .logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.header-logo .logo-icon svg {
    width: 100%;
    height: 100%;
}

.header-logo .logo-text {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 16px;
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

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

.nav-item.is-active {
    color: var(--text-primary);
    background: var(--glass-bg-active);
}

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

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: linear-gradient(135deg, var(--cuebes-primary), var(--cuebes-secondary));
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    color: white;
}

/* User Menu */
.header-user {
    flex-shrink: 0;
}

.user-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 12px 6px 6px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-trigger:hover {
    background: var(--glass-bg-hover);
    border-color: var(--glass-border);
}

.user-name {
    font-size: var(--text-sm);
    font-weight: 500;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
    flex-shrink: 0;
}

.dropdown.is-open .dropdown-chevron {
    transform: rotate(180deg);
}

/* Dropdown info item */
.dropdown-info {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
    cursor: default;
}

.dropdown-info:hover {
    background: transparent;
}

.dropdown-info span {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.dropdown-info .invite-code {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--cuebes-primary-light);
    letter-spacing: 0.05em;
    background: var(--glass-bg);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

/* Main Content Area */
.main-content {
    padding-top: 64px;
    min-height: 100vh;
}

/* Ambient Background */
.ambient-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: ambientFloat 20s ease-in-out infinite;
}

.ambient-orb--1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    top: -200px;
    left: -100px;
}

.ambient-orb--2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.25) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: -7s;
}

.ambient-orb--3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(244, 114, 182, 0.2) 0%, transparent 70%);
    top: 40%;
    left: 60%;
    animation-delay: -14s;
}

@keyframes ambientFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -20px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 30px) scale(0.95);
    }
    75% {
        transform: translate(-30px, -10px) scale(1.02);
    }
}

/* Responsive Header */
@media (max-width: 768px) {
    .main-header {
        height: 56px;
    }

    .main-content {
        padding-top: 56px;
    }

    .header-container {
        padding: 0 var(--space-md);
    }

    .header-logo .logo-text {
        display: none;
    }

    .nav-item span {
        display: none;
    }

    .nav-item {
        padding: 10px;
    }

    .user-name {
        display: none;
    }

    .user-trigger {
        padding: 6px;
    }
}
