/* Global CSS for SEE2AI */

/* ==========================================================================
   THEME VARIABLES (MODULAR DESIGN)
   ========================================================================== */
@layer base {
  :root {
    --background: 0 0% 100%;
    --foreground: 0 0% 10%;
    --brand-orange: 22 100% 50%; /* #FF6B01 */
    --card: 0 0% 100%;
    --card-foreground: 0 0% 15%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --border: 214.3 31.8% 91.4%;
    --nav: 0 0% 100%;
    --popover: 0 0% 100%;
    --popover-foreground: 0 0% 10%;
    --accent: 210 40% 93%;
    --accent-foreground: 0 0% 10%;

    /* Light mode effects */
    --hover-glow: 0 4px 12px rgba(255, 107, 1, 0.15);
    --hover-glow-inset: inset 0 0 0 transparent;
    --hover-border: rgba(255, 107, 1, 0.4);
    
    --text-glow-hover: 0 0 8px rgba(255, 107, 1, 0.3);
    
    --nav-item-glow: 0 0 5px rgba(255, 107, 1, 0.3);
    --nav-item-hover-bg: linear-gradient(90deg, rgba(255, 107, 1, 0.05) 0%, transparent 100%);
    --nav-item-active-bg: linear-gradient(90deg, rgba(255, 107, 1, 0.1) 0%, transparent 100%);
    
    --glass-bg: hsl(var(--card) / 0.85);
    --glass-hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    
    --cyber-grid-color: rgba(0, 0, 0, 0.04);
    
    --neon-text-shadow: 0 2px 8px rgba(255, 107, 1, 0.3);
    --neon-border-shadow: 0 4px 12px rgba(255, 107, 1, 0.15);
    
    --glow-orange-shadow: 0 8px 24px rgba(255, 107, 1, 0.15);
    --glow-green-shadow: 0 8px 24px rgba(34, 197, 94, 0.15);
    
    --input-focus-shadow: 0 0 0 3px rgba(255, 107, 1, 0.1);
  }

  .dark {
    --background: 0 0% 4%; /* #0a0a0a */
    --foreground: 210 40% 98%; /* gray-200 */
    --brand-orange: 22 100% 50%; /* #FF6B01 */
    --card: 0 0% 10%; /* #1a1a1a */
    --card-foreground: 210 40% 98%;
    --muted: 0 0% 15%;
    --muted-foreground: 215 20.2% 65.1%; /* gray-400 */
    --border: 0 0% 20%;
    --nav: 0 0% 4%; /* #0a0a0a */
    --popover: 0 0% 12%; /* #1f1f1f — 略亮于 card，确保浮层与底部内容有层次感 */
    --popover-foreground: 210 40% 98%;
    --accent: 0 0% 18%;
    --accent-foreground: 210 40% 98%;

    /* Dark mode effects */
    --hover-glow: 0 0 20px rgba(255, 107, 1, 0.3);
    --hover-glow-inset: inset 0 0 10px rgba(255, 107, 1, 0.1);
    --hover-border: rgba(255, 107, 1, 0.6);
    
    --text-glow-hover: 0 0 12px rgba(255, 107, 1, 0.6);
    
    --nav-item-glow: 0 0 10px #FF6B01;
    --nav-item-hover-bg: linear-gradient(90deg, rgba(255, 107, 1, 0.08) 0%, transparent 100%);
    --nav-item-active-bg: linear-gradient(90deg, rgba(255, 107, 1, 0.15) 0%, transparent 100%);
    
    --glass-bg: hsl(var(--card) / 0.6);
    --glass-hover-shadow: 0 0 25px rgba(255, 107, 1, 0.15);
    
    --cyber-grid-color: rgba(255, 255, 255, 0.05);
    
    --neon-text-shadow: 0 0 20px rgba(255, 107, 1, 0.5);
    --neon-border-shadow: 0 0 15px rgba(255, 107, 1, 0.2);
    
    --glow-orange-shadow: 0 0 40px rgba(255, 107, 1, 0.3);
    --glow-green-shadow: 0 0 40px rgba(34, 197, 94, 0.2);
    
    --input-focus-shadow: 0 0 15px rgba(255, 107, 1, 0.2);
  }
}

/* ==========================================================================
   CYBERPUNK / HIGH-TECH GLOBAL HOVER EFFECTS
   ========================================================================== */
a, button, .cursor-pointer, [role="button"], .nav-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Buttons and block-level links tech hover */
button:not(.no-tech-hover):not(#sidebar-toggle-btn), 
.btn-tech,
a[class*="border"]:not(.no-tech-hover),
a[class*="bg-"]:not(.no-tech-hover) {
    position: relative;
    overflow: hidden;
}

button:not(.no-tech-hover):not(#sidebar-toggle-btn):hover,
.btn-tech:hover,
a[class*="border"]:not(.no-tech-hover):hover,
a[class*="bg-"]:not(.no-tech-hover):hover {
    box-shadow: var(--hover-glow), var(--hover-glow-inset);
    border-color: var(--hover-border) !important;
    transform: translateY(-1px);
    z-index: 10;
}

/* Text links tech hover (glow + slide) */
a:not([class*="border"]):not([class*="bg-"]):not(.no-tech-hover):not(.logo-link):not(.nav-item):hover {
    text-shadow: var(--text-glow-hover);
    color: #FF6B01 !important;
}

/* Navigation items tech hover */
.nav-item {
    position: relative;
    overflow: hidden;
    border: 1px solid transparent;
    color: hsl(var(--muted-foreground));
}
.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #FF6B01;
    transform: scaleY(0);
    transition: transform 0.3s ease;
    border-radius: 0 4px 4px 0;
    box-shadow: var(--nav-item-glow);
}
.nav-item:hover {
    background: var(--nav-item-hover-bg) !important;
    border-color: rgba(255, 107, 1, 0.2) !important;
    color: hsl(var(--foreground)) !important;
    transform: translateX(4px);
}
.nav-item:hover::before {
    transform: scaleY(0.6);
}
.nav-item:hover svg {
    color: #FF6B01;
    filter: drop-shadow(0 0 5px rgba(255, 107, 1, 0.5));
}

/* Table rows tech hover */
tr.hover\:bg-muted:hover, tr:hover > td {
    background-color: rgba(255, 107, 1, 0.05) !important;
}
tr.hover\:bg-muted:hover {
    box-shadow: inset 2px 0 0 0 #FF6B01;
}

/* Input fields focus tech effect */
input:focus, select:focus, textarea:focus {
    box-shadow: var(--input-focus-shadow) !important;
    border-color: rgba(255, 107, 1, 0.5) !important;
}

/* Interactive Glass Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid hsl(var(--border));
    transition: all 0.3s ease;
}
.glass-panel:hover, a.glass-panel:hover {
    box-shadow: var(--glass-hover-shadow);
    border-color: rgba(255, 107, 1, 0.3);
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.cyber-grid {
    background-size: 40px 40px;
    background-image: linear-gradient(to right, var(--cyber-grid-color) 1px, transparent 1px),
                      linear-gradient(to bottom, var(--cyber-grid-color) 1px, transparent 1px);
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
}

.neon-text {
    text-shadow: var(--neon-text-shadow);
}

.neon-border {
    box-shadow: var(--neon-border-shadow);
    border: 1px solid rgba(255, 107, 1, 0.3);
}

.terminal-header {
    background: hsl(var(--muted));
    border-bottom: 1px solid hsl(var(--border));
}

.glow-orange { box-shadow: var(--glow-orange-shadow); }
.glow-green { box-shadow: var(--glow-green-shadow); }

/* General Dark Theme overrides */
body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    /* Removed background-color and color as they are handled by Tailwind classes */
}

.gradient-brand {
    background: linear-gradient(135deg, #FF6B01 0%, #FF8B40 100%);
}

.gradient-dark {
    /* Adjusted for light/dark mode compatibility */
    background: linear-gradient(180deg, var(--card) 0%, var(--background) 100%);
}

.card-hover { transition: all 0.3s ease; }
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(255, 107, 1, 0.15);
}

/* ==========================================================================
   NAVIGATION ACTIVE & SIDEBAR STYLES
   ========================================================================== */
.nav-active { 
    background: var(--nav-item-active-bg);
    border-color: rgba(255,107,1,0.3);
    color: hsl(var(--foreground));
}
.nav-active::before {
    transform: scaleY(1);
}
.nav-active svg {
    color: #FF6B01;
    filter: drop-shadow(0 0 5px rgba(255,107,1,0.5));
}

/* Sidebar collapsed state */
#sidebar.collapsed .sidebar-text {
    opacity: 0;
    width: 0;
    padding: 0;
    margin: 0;
    pointer-events: none;
    display: none;
}
#sidebar.collapsed .sidebar-header {
    opacity: 0;
    width: 0;
    height: 0;
    padding: 0;
    margin: 0;
    pointer-events: none;
    display: none;
}
#sidebar.collapsed .nav-item {
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    margin: 0.5rem auto;
    border-radius: 0.75rem;
}
#sidebar.collapsed #logo-container {
    padding-left: 0;
    padding-right: 0;
    justify-content: center;
}
#sidebar.collapsed .logo-link {
    justify-content: center;
    gap: 0;
}

/* ==========================================================================
   API DOC STYLES
   ========================================================================== */
.api-doc pre {
    background: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border-radius: 12px;
    padding: 16px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid hsl(var(--border));
}
.api-doc code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
.api-doc pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}
.api-doc p code, .api-doc li code {
    background: hsl(var(--muted));
    color: #FF6B01;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.api-doc h2 { 
    font-size: 1.5rem; 
    font-weight: 700; 
    color: hsl(var(--foreground)); 
    margin-top: 32px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #FF6B01;
    display: flex;
    align-items: center;
    gap: 8px;
}
.api-doc h3 { 
    font-size: 1.125rem; 
    font-weight: 600; 
    color: hsl(var(--foreground)); 
    margin-top: 24px;
    margin-bottom: 12px;
}
.api-doc p { color: hsl(var(--muted-foreground)); line-height: 1.8; margin-bottom: 16px; }
.api-doc ul { list-style: none; padding-left: 0; margin-bottom: 16px; }
.api-doc ul li { padding-left: 20px; position: relative; margin-bottom: 8px; color: hsl(var(--muted-foreground)); }
.api-doc ul li::before { content: "→"; position: absolute; left: 0; color: #FF6B01; font-weight: bold; }
.api-doc table { width: 100%; border-collapse: separate; border-spacing: 0; margin-top: 16px; margin-bottom: 24px; font-size: 14px; border-radius: 8px; overflow: hidden; border: 1px solid hsl(var(--border)); }
.api-doc th, .api-doc td { border-bottom: 1px solid hsl(var(--border)); padding: 12px 16px; text-align: left; }
.api-doc th { 
    background-color: hsl(var(--muted)); 
    font-weight: 600; 
    color: hsl(var(--foreground));
}
.api-doc tr:last-child td { border-bottom: none; }
.api-doc tr:nth-child(even) { background-color: hsl(var(--muted) / 0.5); }
.api-doc tr:hover { background-color: hsl(var(--muted)); }
.api-doc blockquote {
    border-left: 4px solid #FF6B01;
    background: rgba(255, 107, 1, 0.05);
    padding: 16px;
    border-radius: 0 8px 8px 0;
    color: hsl(var(--muted-foreground));
    margin: 16px 0;
    font-size: 14px;
}
.api-doc hr {
    border: none;
    border-top: 1px solid hsl(var(--border));
    margin: 32px 0;
}
.api-doc strong {
    color: hsl(var(--foreground));
    font-weight: 600;
}
.api-doc a {
    color: #FF6B01;
    text-decoration: none;
}
.api-doc a:hover {
    text-decoration: underline;
}

.invitation-card,
.invitation-code-card,
.invitation-empty-card,
.invitation-readonly-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    padding: 1rem;
}

.dark .invitation-card,
.dark .invitation-code-card,
.dark .invitation-empty-card,
.dark .invitation-readonly-card {
    background: rgba(17, 24, 39, 0.5);
}

.invitation-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: hsl(var(--foreground));
}

.invitation-input {
    width: 100%;
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    padding: 0.75rem 0.875rem;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
}

.invitation-input:focus {
    outline: none;
    border-color: hsl(var(--brand-orange));
    box-shadow: 0 0 0 3px rgba(255, 107, 1, 0.12);
}

.invitation-primary-btn,
.invitation-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.invitation-primary-btn {
    background: linear-gradient(135deg, #ff6b01 0%, #ff9f43 100%);
    color: #fff;
}

.invitation-primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(255, 107, 1, 0.18);
}

.invitation-secondary-btn {
    border: 1px solid rgba(255, 107, 1, 0.25);
    color: hsl(var(--brand-orange));
    background: rgba(255, 107, 1, 0.08);
}

.invitation-secondary-btn:hover {
    background: rgba(255, 107, 1, 0.14);
}

.invitation-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.invitation-status-unused {
    background: rgba(255, 107, 1, 0.12);
    color: #ff6b01;
}

.invitation-status-used {
    /* Why: "used" is a neutral inventory state, not a new functional accent. */
    background: rgba(75, 75, 75, 0.12);
    color: #4b4b4b;
}

.invitation-status-pending {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.invitation-status-approved {
    background: rgba(34, 197, 94, 0.14);
    color: #15803d;
}

.invitation-status-rejected {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.invitation-code-value {
    margin-top: 0.25rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: hsl(var(--brand-orange));
}

.invitation-celebration {
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 107, 1, 0.2);
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(255, 107, 1, 0.12), rgba(34, 197, 94, 0.08));
    padding: 1rem 1.25rem;
    animation: invitationPopIn 0.22s ease-out;
}

.invitation-celebration-title {
    font-size: 1rem;
    font-weight: 800;
    color: hsl(var(--brand-orange));
}

.invitation-celebration-text {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: hsl(var(--foreground));
}

@keyframes invitationPopIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
