/**
 * Project Nexus Design System - Core Styles
 * Base variables and utility classes for all layouts
 */

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

[x-cloak] {
   display: none !important;
}

html,
body {
   height: 100%;
   font-family: "Inter", "Geist", ui-sans-serif, system-ui, sans-serif,
      "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
   background: #000000;
   color: #ffffff;
   overflow-x: hidden;
   scrollbar-width: thin;
   scrollbar-color: gray transparent;
}

/* CSS Variables */
:root {
   --radius: 0.625rem;
   --radius-sm: calc(var(--radius) - 4px);
   --radius-md: calc(var(--radius) - 2px);
   --radius-lg: var(--radius);
   --radius-xl: calc(var(--radius) + 4px);

   --background: #000000;
   --foreground: #ffffff;
   --card: oklch(0.205 0 0);
   --card-foreground: oklch(0.985 0 0);
   --primary: oklch(0.922 0 0);
   --primary-foreground: oklch(0.205 0 0);
   --secondary: oklch(0.269 0 0);
   --secondary-foreground: oklch(0.985 0 0);
   --muted: oklch(0.269 0 0);
   --muted-foreground: oklch(0.708 0 0);
   --border: oklch(1 0 0 / 10%);
   --input: oklch(1 0 0 / 15%);
   --ring: oklch(0.556 0 0);

   --sidebar-width: 18rem;
   --sidebar-collapsed-width: 80px;
   --admin-navbar-height: 56px;
}

/* ========================================
   Spacing Utilities
   ======================================== */

.nx-space-y-2>*+* {
   margin-top: 0.5rem;
}

.nx-space-y-5>*+* {
   margin-top: 1.25rem;
}

/* ========================================
   Layout Utilities
   ======================================== */

.nx-relative {
   position: relative;
}

.nx-hidden {
   display: none;
}

/* ========================================
   Sizing
   ======================================== */

.nx-w-4 {
   width: 1rem;
}

.nx-h-4 {
   height: 1rem;
}

.nx-w-8 {
   width: 2rem;
}

.nx-h-8 {
   height: 2rem;
}

.nx-w-full {
   width: 100%;
}

.nx-max-w-sm {
   max-width: 24rem;
}

.nx-max-w-md {
   max-width: 28rem;
}

.nx-max-w-lg {
   max-width: 32rem;
}

.nx-max-w-xl {
   max-width: 36rem;
}

.nx-max-w-2xl {
   max-width: 42rem;
}

/* ========================================
   Padding
   ======================================== */

.nx-pr-10 {
   padding-right: 2.5rem;
}

.nx-pt-2 {
   padding-top: 0.5rem;
}

.nx-pt-6 {
   padding-top: 1.5rem;
}

.nx-p-4 {
   padding: 1rem;
}

.nx-p-8 {
   padding: 2rem;
}

/* ========================================
   Margin
   ======================================== */

.nx-mx-auto {
   margin-left: auto;
   margin-right: auto;
}

.nx-m-0 {
   margin: 0;
}

.nx-mb-2 {
   margin-bottom: 0.5rem;
}

.nx-mb-4 {
   margin-bottom: 1rem;
}

.nx-mb-6 {
   margin-bottom: 1.5rem;
}

.nx-mb-8 {
   margin-bottom: 2rem;
}

.nx-mt-4 {
   margin-top: 1rem;
}

.nx-mt-6 {
   margin-top: 1.5rem;
}

.nx-ml-auto {
   margin-left: auto;
}

/* ========================================
   Text
   ======================================== */

.nx-text-center {
   text-align: center;
}

.nx-text-left {
   text-align: left;
}

.nx-text-right {
   text-align: right;
}

.nx-text-red-400 {
   color: rgb(248, 113, 113);
}

.nx-text-sm {
   font-size: 0.875rem;
}

.nx-font-medium {
   font-weight: 500;
}

/* ========================================
   Flexbox
   ======================================== */

.nx-flex {
   display: flex;
}

.nx-flex-col {
   flex-direction: column;
}

.nx-items-center {
   align-items: center;
}

.nx-justify-center {
   justify-content: center;
}

.nx-justify-between {
   justify-content: space-between;
}

.nx-gap-2 {
   gap: 0.5rem;
}

.nx-gap-3 {
   gap: 0.75rem;
}

.nx-gap-4 {
   gap: 1rem;
}

/* ========================================
   Container
   ======================================== */

.nx-min-h-screen {
   min-height: 100vh;
}

/* ========================================
   Animations
   ======================================== */

@keyframes nxFadeInUp {
   from {
      opacity: 0;
      transform: translateY(1rem);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

@keyframes nxPulse {

   0%,
   100% {
      opacity: 0.5;
      transform: scale(1);
   }

   50% {
      opacity: 1;
      transform: scale(1.05);
   }
}

/* ========================================
   Lucide Icons
   ======================================== */

.lucide {
   display: inline-block;
   vertical-align: middle;
   flex-shrink: 0;
}

.lucide[data-lucide] {
   width: auto;
   height: auto;
}

/* Spinner animation for loader icon */
.lucide[data-lucide="loader"] {
   animation: nx-spin 1s linear infinite;
}

@keyframes nx-spin {
   from {
      transform: rotate(0deg);
   }

   to {
      transform: rotate(360deg);
   }
}

/* ========================================
    Message Composer
    ======================================== */

.nx-composer-card {
   display: flex;
   flex-direction: column;
   gap: 1rem;
   padding: 1rem;
   border: 1px solid rgba(255, 255, 255, 0.08);
   border-radius: var(--radius-lg);
   background: rgba(255, 255, 255, 0.03);
}

.nx-composer-grid {
   display: grid;
   grid-template-columns: repeat(2, minmax(0, 1fr));
   gap: 1rem;
}

.nx-composer-span-full {
   grid-column: 1 / -1;
}

.nx-composer-stack {
   display: flex;
   flex-direction: column;
   gap: 1rem;
}

.nx-composer-stack-tight {
   gap: 0.75rem;
   margin-bottom: 0.75rem;
}

.nx-composer-toolbar {
   display: flex;
   align-items: flex-start;
   justify-content: space-between;
   gap: 1rem;
}

.nx-composer-select {
   max-width: 14rem;
}

.nx-composer-item {
   display: flex;
   flex-direction: column;
   gap: 0.875rem;
   padding: 0.875rem;
   border-radius: var(--radius);
   border: 1px solid rgba(255, 255, 255, 0.08);
   background: rgba(255, 255, 255, 0.04);
}

.nx-composer-item-subtle {
   background: rgba(255, 255, 255, 0.025);
}

.nx-composer-item-inline,
.nx-composer-item-button {
   flex-direction: row;
   align-items: center;
   justify-content: space-between;
}

.nx-composer-item-button {
   width: 100%;
   cursor: pointer;
   text-align: left;
}

.nx-composer-item-active {
   border-color: rgba(99, 102, 241, 0.8);
   background: rgba(99, 102, 241, 0.12);
}

.nx-composer-item-header {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 0.75rem;
}

.nx-composer-item-actions {
   display: flex;
   align-items: center;
   gap: 0.5rem;
}

.nx-composer-item-main {
   flex: 1;
   min-width: 0;
}

.nx-composer-item-title {
   font-size: 0.875rem;
   font-weight: 600;
   color: rgba(255, 255, 255, 0.96);
}

.nx-composer-meta {
   margin-top: 0.2rem;
   font-size: 0.75rem;
   color: rgba(255, 255, 255, 0.55);
}

.nx-composer-meta-success {
   margin-bottom: 0.5rem;
   color: #4ade80;
   font-weight: 600;
}

.nx-composer-hint {
   padding: 0.875rem 1rem;
   border-radius: var(--radius);
   border: 1px dashed rgba(255, 255, 255, 0.14);
   background: rgba(255, 255, 255, 0.02);
   color: rgba(255, 255, 255, 0.7);
   font-size: 0.8125rem;
}

.nx-composer-pill {
   display: inline-flex;
   align-items: center;
   padding: 0.25rem 0.55rem;
   border-radius: 999px;
   background: rgba(74, 222, 128, 0.18);
   color: #86efac;
   font-size: 0.75rem;
   font-weight: 600;
}

.nx-composer-link {
   margin-left: 0.5rem;
   border: none;
   background: none;
   color: rgba(255, 255, 255, 0.45);
   cursor: pointer;
   font-size: 0.75rem;
   text-decoration: underline;
}

.nx-composer-avatar {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 2rem;
   height: 2rem;
   border-radius: 999px;
   background: rgba(255, 255, 255, 0.1);
   font-size: 0.75rem;
   font-weight: 700;
   flex-shrink: 0;
}

.nx-composer-modal {
   max-width: 560px;
}

.nx-composer-modal-body {
   padding: 0;
   display: flex;
   flex-direction: column;
   height: 520px;
}

.nx-composer-modal-footer {
   justify-content: space-between;
}

.nx-composer-search-wrap {
   padding: 0.75rem 1rem;
   border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nx-composer-search-input {
   position: relative;
}

.nx-composer-search-icon {
   position: absolute;
   left: 0.75rem;
   top: 50%;
   transform: translateY(-50%);
   color: rgba(255, 255, 255, 0.35);
}

.nx-composer-search-input .nx-input {
   width: 100%;
   padding-left: 2.4rem;
   font-size: 0.8125rem;
}

.nx-composer-scroll-panel {
   flex: 1;
   overflow-y: auto;
   display: flex;
   flex-direction: column;
}

@media (max-width: 900px) {
   .nx-composer-grid {
      grid-template-columns: minmax(0, 1fr);
   }

   .nx-composer-toolbar,
   .nx-composer-item-inline,
   .nx-composer-item-button,
   .nx-composer-item-header {
      flex-direction: column;
      align-items: stretch;
   }

   .nx-composer-select {
      max-width: 100%;
   }
}