/* ============================================================================
   BENTO DESIGN SYSTEM - NoteFlow AI & NodeFlow AI (Manifest Canvas)
   ============================================================================ */

:root {
    /* Colors */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #1c2128;
    --bg-card: rgba(45, 51, 59, 0.6);
    --bg-card-hover: rgba(45, 51, 59, 0.8);
    
    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-default: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(88, 166, 255, 0.3);
    
    /* Accent Colors */
    --accent-blue: #58a6ff;
    --accent-purple: #bc8cff;
    --accent-green: #3fb950;
    --accent-orange: #d29922;
    --accent-red: #f85149;
    
    /* Text */
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-tertiary: #6e7681;
    
    /* Spacing */
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(88, 166, 255, 0.2);
}

/* ============================================================================
   BENTO CARD COMPONENTS
   ============================================================================ */

.bento-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.bento-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bento-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--bg-card-hover);
}

.bento-card:hover::before {
    opacity: 1;
}

/* Card Variants */
.bento-card-compact {
    padding: var(--space-md);
}

.bento-card-glass {
    background: rgba(45, 51, 59, 0.4);
    backdrop-filter: blur(20px);
}

.bento-card-accent {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(88, 166, 255, 0.1);
}

/* ============================================================================
   BENTO GRID LAYOUTS
   ============================================================================ */

.bento-grid {
    display: grid;
    gap: var(--space-md);
    padding: var(--space-md);
}

.bento-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.bento-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.bento-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Grid Item Spans */
.span-2 {
    grid-column: span 2;
}

.span-3 {
    grid-column: span 3;
}

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

/* ============================================================================
   LAYOUT STRUCTURE
   ============================================================================ */

.app-container {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100vh;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

.app-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-default);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    flex-shrink: 0;
}

.app-body {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 0;
    overflow: hidden;
    min-height: 0;
}

.sidebar-left,
.sidebar-right {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-default);
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid var(--border-default);
}

.main-content {
    background: var(--bg-primary);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ============================================================================
   SECTION HEADERS
   ============================================================================ */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn-bento {
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.btn-bento:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 111, 235, 0.3);
}

.btn-bento-primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.btn-bento-primary:hover {
    background: #4a8fd8;
    border-color: #4a8fd8;
    box-shadow: 0 4px 12px rgba(74, 143, 216, 0.4);
}

.btn-bento-success {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.btn-bento-success:hover {
    background: #2ea043;
    border-color: #2ea043;
    box-shadow: 0 4px 12px rgba(63, 185, 80, 0.3);
}

.btn-bento-icon {
    padding: var(--space-sm);
    aspect-ratio: 1;
}

/* ============================================================================
   INPUTS
   ============================================================================ */

.input-bento {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
    transition: all 0.2s ease;
}

.input-bento:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.input-bento::placeholder {
    color: var(--text-tertiary);
}

/* ============================================================================
   SCROLLBARS
   ============================================================================ */

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-card);
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

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

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-slide-in {
    animation: slideIn 0.3s ease;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

.text-blue { color: var(--accent-blue); }
.text-purple { color: var(--accent-purple); }
.text-green { color: var(--accent-green); }
.text-orange { color: var(--accent-orange); }
.text-red { color: var(--accent-red); }

.bg-blue { background: var(--accent-blue); }
.bg-purple { background: var(--accent-purple); }
.bg-green { background: var(--accent-green); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: 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); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
