/* Article Editor Styles - 70/30 Sticky Sidebar */
:root { 
    --sidebar-width: 30%;
    --primary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --sidebar-top-spacing: 2rem;
}

/* 1. THE GRID CONTAINER */
.editor-grid { 
    display: grid; 
    grid-template-columns: 1fr var(--sidebar-width); 
    gap: 2rem; 
    /* CRITICAL: align-items start prevents the sidebar from stretching 
       to the height of the main content, which breaks 'sticky' */
    align-items: start;
    min-height: 100vh;
    position: relative;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* 2. THE STICKY SIDEBAR COLUMN */
.sidebar-column {
    position: -webkit-sticky; /* Safari support */
    position: sticky;
    top: var(--sidebar-top-spacing); 
    
    /* Calculate height: viewport minus top/bottom buffer */
    max-height: calc(100vh - (var(--sidebar-top-spacing) * 2)); 
    
    /* Enable internal scrolling */
    overflow-y: auto; 
    padding-right: 4px; /* Space for a ghost scrollbar if needed */
    padding-bottom: 5rem; /* Extra padding so bottom modules aren't cut off */
    
    /* Smoothness */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;

    /* Hide scrollbars (Standard) */
    scrollbar-width: none; 
    -ms-overflow-style: none;
}

/* Hide scrollbars (Chrome/Safari/Edge) */
.sidebar-column::-webkit-scrollbar {
    display: none;
}

/* 3. SIDEBAR MODULES */
.sidebar-module {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* 4. RESPONSIVE RESET */
@media (max-width: 1200px) {
    .editor-grid { 
        grid-template-columns: 1fr; 
        /* padding: 1rem; */
    }
    .sidebar-column {
        position: static; /* Remove sticky on mobile */
        max-height: none;
        overflow-y: visible;
    }
}

/* --- FUNCTIONAL UI STYLES --- */

.state-badge {
    animation: slideIn 0.2s ease-out;
}

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

.entity-badge {
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.entity-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.search-result-item {
    transition: background-color 0.2s;
    cursor: pointer;
}

.search-result-item:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.type-badge {
    border-radius: 1rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Validation states */
.validation-valid {
    border-color: var(--success-color);
    background-color: rgba(16, 185, 129, 0.02);
}

.validation-error {
    border-color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.02);
}

/* Toast Borders */
.toast-border-success { border-left: 6px solid #22c55e !important; }
.toast-border-error   { border-left: 6px solid #ef4444 !important; }
.toast-border-warning { border-left: 6px solid #f59e0b !important; }
.toast-border-info    { border-left: 6px solid #3b82f6 !important; }

/* Entity badges colors */
.entity-badge-player {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

.entity-badge-team {
    background-color: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.2);
    color: #166534;
}

.entity-badge-league {
    background-color: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.2);
    color: #7c3aed;
}