/* ============================================
   BENTO GRID SYSTEM
   ============================================ */

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    gap: var(--spacing-lg);
    padding-bottom: var(--spacing-xl);
}

/* Base Widget Style */
.bento-card {
    background: var(--bg-surface-0);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
}

.bento-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-subtle);
}

/* ============================================
   WIDGET VARIATIONS
   ============================================ */

/* 1. Welcome Header (Full Width) */
.bento-welcome {
    grid-column: span 4;
    background: linear-gradient(135deg, var(--primary-color), #4338ca);
    color: white;
    min-height: 140px; /* Reduced from 180px */
    display: flex;
    justify-content: center;
    border: none;
    position: relative;
}

.welcome-content h1 {
    color: white;
    font-size: 2.25rem;
    margin-bottom: 8px;
}

.welcome-sub {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    display: flex;
    gap: 16px;
    align-items: center;
}

/* 2. Primary Stats (Squares) */
.bento-stat {
    grid-column: span 1;
    min-height: 140px;
    justify-content: space-between;
}

.stat-icon-bg {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 3. Action Cards (Tall or Wide) */
/* 3. Action Cards / Clickable Cards */
.bento-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease;
    display: block;
    height: 100%; /* Ensure it fills the grid cell if wrapped */
}

.bento-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-subtle);
    color: inherit;
}

.bento-action {
    grid-column: span 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    aspect-ratio: 1/1;
}

.bento-action:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.action-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--primary-color);
}

/* Hover Actions in Lists */
.list-item-card {
    position: relative;
}

.hover-action-btn {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.list-item-card:hover .hover-action-btn {
    opacity: 1;
}

/* 4. Large Lists (Spans 2 columns by default, can be overridden) */
.bento-list {
    min-height: 400px;
}

/* Full-width list variant */
.bento-list[style*="grid-column: span 4"] {
    min-height: 300px;
}

/* Horizontal grid layout for Industry Pulse */
.industry-pulse-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    overflow-y: visible !important;
    max-height: none !important;
    flex-direction: row !important;
}

.industry-pulse-grid .list-item-card {
    margin-bottom: 0;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.list-title {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bento-list-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    /* Hide scrollbar but allow scroll */
    scrollbar-width: none;
}

.list-item-card {
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-1);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.list-item-card:hover {
    background: white;
    border-color: var(--primary-subtle);
    box-shadow: var(--shadow-sm);
}

/* 5. Profile Score (Feature) */
.bento-feature {
    grid-column: span 1;
    grid-row: span 2;
    background: var(--bg-surface-0);
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
}

/* Profile Checklist Styles */
.profile-checklist {
    width: 100%;
    padding: 0 4px;
}

.checklist-item {
    padding: 4px 0;
    transition: opacity 0.2s ease;
}

.checklist-item.strength {
    color: var(--text-secondary, #6b7280);
}

.checklist-item.strength i {
    color: #10b981; /* Green for strengths */
}

.checklist-item.opportunity {
    color: var(--text-secondary, #6b7280);
}

.checklist-item.opportunity i {
    color: #f59e0b; /* Orange/amber for opportunities */
}

.checklist-item span {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ============================================
   RESPONSIVE LAYOUT
   ============================================ */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bento-welcome {
        grid-column: span 2;
    }

    .bento-list {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .bento-grid {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .bento-welcome {
        min-height: auto;
        padding: var(--spacing-lg);
        text-align: left;
        align-items: flex-start;
    }

    .welcome-sub {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        font-size: 0.9rem;
    }

    .bento-stat {
        flex-direction: row;
        align-items: center;
        min-height: 80px;
        padding: 16px;
    }

    .stat-icon-bg {
        margin-bottom: 0;
        margin-right: 16px;
    }

    .stat-content {
        text-align: right;
    }

    /* Mobile Action Grid */
    .mobile-actions-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .bento-action {
        aspect-ratio: auto;
        /* Remove explicit square constraint on mobile if content needs more space */
        padding: 24px;
    }
}