/**
 * SAGE v0.6 - Product Page Styles
 * Simple, bulletproof full-height layout
 */

/* ========================================
   LAYOUT - Full height two-column grid
   ======================================== */

.product-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem;
    box-sizing: border-box;
    min-height: 0;
}

.product-page-content {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.products-column,
.stories-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-base);
    border-radius: 8px;
    padding: 1rem;
    min-height: 0;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: var(--border-ui);
}

.column-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: var(--font-weight-bold);
}

.products-list,
.stories-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Filter Banner - inside the list */
.filter-banner {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg-lower);
    border-radius: 4px;
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-banner.assignment-mode {
    background: #e3f2fd;
    border: 1px solid #2196f3;
}

.assignment-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ========================================
   CARDS - Compact card styling
   ======================================== */

.card {
    background: var(--bg-raised);
    border: var(--border-ui);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.card:hover {
    border-color: #2196f3;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.card-header-main {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.card-header-actions {
    flex-shrink: 0;
    margin-left: 0.5rem;
}

/* Card Names */
.product-name,
.story-name {
    margin: 0;
    font-size: 0.9rem;
    font-weight: var(--font-weight-semibold);
}

.editable-name,
.editable-description {
    cursor: pointer;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 2px;
}

.editable-name:hover,
.editable-description:hover {
    background: var(--bg-lower);
}

/* Stats */
.product-stats,
.story-stats {
    display: flex;
    gap: 0.25rem;
    font-size: 0.7rem;
}

.story-count,
.step-count {
    background: var(--bg-lower);
    padding: 2px 6px;
    border-radius: 10px;
}

/* Card Body */
.card-body {
    margin-bottom: 0.25rem;
}

.product-description,
.story-description {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Footer */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.25rem;
    border-top: var(--border-ui);
    margin-top: 0.25rem;
}

.last-modified {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.card-actions {
    display: flex;
    gap: 0.25rem;
}

/* Card Details (Accordion) */
.card-details {
    background: var(--bg-base);
    border-top: var(--border-ui);
    margin: 0.5rem -0.75rem -0.75rem;
    border-radius: 0 0 6px 6px;
}

.detail-section {
    padding: 0.75rem;
}

.detail-section h5 {
    margin: 0 0 0.5rem 0;
    font-size: 0.7rem;
    font-weight: var(--font-weight-bold);
    color: var(--text-secondary);
    text-transform: uppercase;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Checkbox & Labels */
.card-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.card-action-label {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--bg-lower);
    color: var(--text-muted);
}

.card-action-label.product-badge {
    background: #e3f2fd;
    color: #1976d2;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.empty-state h3 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
}

/* Edit inputs */
.name-edit-input {
    font-size: inherit;
    font-weight: inherit;
    border: 2px solid #2196f3;
    border-radius: 2px;
    padding: 2px 4px;
    width: 150px;
}

.name-edit-buttons,
.description-edit-buttons {
    display: inline-flex;
    gap: 0.25rem;
    margin-left: 0.25rem;
}

.description-edit-textarea {
    width: 100%;
    border: 2px solid #2196f3;
    border-radius: 2px;
    padding: 4px;
    font-size: inherit;
    min-height: 60px;
    resize: vertical;
}

/* Nested indicator */
.nested-indicator {
    font-size: 0.7rem;
    color: #4caf50;
    background: #e8f5e9;
    padding: 2px 6px;
    border-radius: 2px;
}

/* Story hierarchy */
.story-card-wrapper {
    position: relative;
}

.story-card-wrapper.indent-1 {
    border-left: 2px solid var(--grey-light);
    padding-left: 0.5rem;
}

.story-card-wrapper.indent-2 {
    border-left: 2px solid var(--grey-light);
    padding-left: 0.5rem;
}

.expand-toggle {
    cursor: pointer;
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    user-select: none;
}

.expand-toggle:hover {
    background: var(--bg-lower);
}

/* Assigned stories in product details */
.assigned-story-item {
    font-size: 0.75rem;
    padding: 0.25rem 0;
    border-bottom: var(--border-ui);
}

.assigned-story-item:last-child {
    border-bottom: none;
}

/* Story info */
.story-info p {
    margin: 0.25rem 0;
    font-size: 0.75rem;
}
