/* ===============================================
   PANELS.CSS - Collapsible Panel Styling
   IDENTICAL visual styling to Operator app
   =============================================== */

/* ===================================
   COLLAPSIBLE PANEL
   =================================== */

.panel-section {
    margin-bottom: var(--space-lg);  /* Match dashboard-section */
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);  /* 8px - match dashboard-section */
    background: var(--bg-secondary);  /* #fafaf9 - match dashboard-section */
    overflow: hidden;
    box-shadow: none;  /* Flat design */
    transition: all 0.3s var(--ease-out);
}

.panel-section:last-child {
    margin-bottom: 0;
}

/* Panel Header */
.panel-header {
    height: 56px;  /* Slightly more compact */
    padding: 0 var(--space-md);  /* Match section padding */
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;  /* Inherit from panel-section */
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.panel-section.expanded .panel-header {
    border-bottom: none;
}

.panel-header:hover {
    background: rgba(0, 0, 0, 0.02);  /* Very subtle hover on light beige */
}

/* Left side of header */
.panel-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
}

.panel-header-left .category-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
    color: var(--color-primary);
}

.panel-title {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-separator {
    color: var(--text-muted);
    user-select: none;
    line-height: 1;
}

.category-stats {
    font-size: var(--text-sm);
    color: var(--text-muted);
    font-weight: var(--font-weight-normal);
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Right side of header */
.panel-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.panel-chevron {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    transition: transform 0.3s var(--ease-out);
    font-size: 16px;
}

.panel-section.expanded .panel-chevron {
    transform: rotate(180deg);
}

/* Panel Content */
.panel-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease-out), 
                opacity 0.3s var(--ease-out), 
                padding 0.3s var(--ease-out);
}

.panel-section.expanded .panel-content {
    max-height: 2000px;
    opacity: 1;
    padding: var(--space-md);  /* Match section padding */
}

.panel-content.scrollable {
    overflow-y: auto;
    max-height: 500px;
}

/* ===================================
   SECTION PANEL (Non-collapsible)
   THE STANDARD FOR ALL TAB CONTENT
   Claude-inspired flat design with clear hierarchy
   =================================== */

.dashboard-section {
    background: var(--bg-white);  /* White background */
    border: 1px solid var(--border-light);  /* #e8e7e5 */
    border-radius: var(--radius-lg);  /* 8px */
    padding: var(--space-md);  /* 12px internal padding */
    margin-bottom: var(--space-lg);  /* 16px between sections */
}

.dashboard-section:last-child {
    margin-bottom: 0;  /* No margin on last section */
}

/* Section Header - Compact, Professional */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);  /* 12px */
    padding-bottom: var(--space-sm);  /* 8px - slightly more padding */
    border-bottom: 1px solid var(--border-light);
    gap: var(--space-md);  /* 12px between title and controls */
    flex-shrink: 0;
}

.section-title {
    font-size: var(--text-lg);  /* 15px - Compact but readable */
    font-weight: var(--font-weight-semibold);  /* 600 */
    color: var(--text-primary);
    margin: 0;
    flex-shrink: 0;  /* Don't shrink title */
    white-space: nowrap;
}

/* Controls Container (Filters + Actions) */
.section-controls {
    display: flex;
    align-items: center;
    gap: var(--space-md);  /* 12px between filter group and action group */
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Filter Group */
.section-filters {
    display: flex;
    gap: var(--space-sm);  /* 8px between filters */
    align-items: center;
}

.filter-select,
.filter-search {
    padding: var(--space-xs) var(--space-sm);  /* 4px 8px - Compact */
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    color: var(--text-body);
    font-size: var(--text-sm);  /* 13px */
    min-width: 140px;
    height: 32px;  /* Compact fixed height */
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.filter-search {
    cursor: text;
}

.filter-select:hover,
.filter-search:hover {
    border-color: var(--color-primary);
}

.filter-select:focus,
.filter-search:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

/* Action Buttons Group */
.section-actions {
    display: flex;
    gap: var(--space-sm);  /* 8px between buttons */
    align-items: center;
}

/* Compact buttons in sections */
.section-actions .btn-primary,
.section-actions .btn-secondary {
    padding: var(--space-xs) var(--space-md);  /* 4px 12px - Compact */
    font-size: var(--text-sm);  /* 13px */
    min-height: 32px;  /* Match filter height */
    height: 32px;
}

/* Section Content Area */
.section-content {
    /* Content inherits background from parent (.dashboard-section) */
    min-height: 0;
}

.section-content.scrollable-content {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }
    
    .section-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .panel-header {
        height: auto;
        min-height: 64px;
        padding: var(--space-md);
    }
    
    .panel-header-left {
        flex-wrap: wrap;
    }
}

