/**
 * AI Content Lab — Dashboard Section Styles
 * Shows AI-generated content analytics for organizers/admins.
 * Design: dark theme (#0F2A2A), green accent (#8BFF22), glassmorphism cards.
 */

/* ========================================
   SECTION CONTAINER
======================================== */
.ai-content-lab-section {
    margin-top: 2rem;
}

.ai-content-lab-section .widget-card {
    background: rgba(13, 79, 79, 0.2);
    border: 1px solid rgba(139, 255, 34, 0.08);
}

.ai-content-lab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.ai-content-lab-header .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-content-lab-header .header-left h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
}

.ai-content-lab-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 14px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    background: linear-gradient(135deg, rgba(139, 255, 34, 0.15), rgba(13, 79, 79, 0.4));
    color: #8BFF22;
    border: 1px solid rgba(139, 255, 34, 0.2);
}

.ai-content-lab-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-cl-period-select {
    padding: 6px 12px;
    background: rgba(13, 79, 79, 0.5);
    color: #c0e8d0;
    border: 1px solid rgba(139, 255, 34, 0.15);
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
}

.ai-cl-period-select:focus {
    outline: none;
    border-color: #8BFF22;
}

.ai-cl-tab-bar {
    display: flex;
    gap: 2px;
    background: rgba(13, 79, 79, 0.3);
    border-radius: 10px;
    padding: 3px;
}

.ai-cl-tab {
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(192, 232, 208, 0.5);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ai-cl-tab:hover {
    color: #c0e8d0;
    background: rgba(139, 255, 34, 0.06);
}

.ai-cl-tab.active {
    background: rgba(139, 255, 34, 0.15);
    color: #8BFF22;
}

/* ========================================
   OVERVIEW STRIP
======================================== */
.ai-cl-overview-strip {
    display: flex;
    gap: 8px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(139, 255, 34, 0.08);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.ai-cl-mini-stat {
    flex: 1;
    min-width: 100px;
    text-align: center;
    padding: 10px 8px;
    background: rgba(13, 79, 79, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(139, 255, 34, 0.06);
    transition: border-color 0.2s;
}

.ai-cl-mini-stat:hover {
    border-color: rgba(139, 255, 34, 0.2);
}

.ai-cl-mini-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #8BFF22;
    font-variant-numeric: tabular-nums;
}

.ai-cl-mini-stat-label {
    font-size: 0.68rem;
    color: rgba(192, 232, 208, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
}

/* ========================================
   TAB PANELS
======================================== */
.ai-cl-panel {
    display: none;
}

.ai-cl-panel.active {
    display: block;
}

/* ========================================
   CONTENT FEED (Recent tab)
======================================== */
.ai-cl-feed {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 4px;
}

.ai-cl-feed::-webkit-scrollbar { width: 4px; }
.ai-cl-feed::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); border-radius: 2px; }
.ai-cl-feed::-webkit-scrollbar-thumb { background: rgba(139,255,34,0.15); border-radius: 2px; }

/* Individual content card */
.ai-cl-content-card {
    background: rgba(13, 79, 79, 0.25);
    border: 1px solid rgba(139, 255, 34, 0.08);
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.ai-cl-content-card:hover {
    border-color: rgba(139, 255, 34, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.ai-cl-content-card.is-favorite {
    border-color: rgba(234, 179, 8, 0.3);
}

.ai-cl-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ai-cl-action-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.ai-cl-action-icon.act-trendy { background: rgba(236, 72, 153, 0.12); }
.ai-cl-action-icon.act-seo { background: rgba(245, 158, 11, 0.12); }
.ai-cl-action-icon.act-describe { background: rgba(96, 165, 250, 0.12); }
.ai-cl-action-icon.act-improve { background: rgba(34, 197, 94, 0.12); }
.ai-cl-action-icon.act-category { background: rgba(168, 85, 247, 0.12); }
.ai-cl-action-icon.act-pricing { background: rgba(20, 184, 166, 0.12); }
.ai-cl-action-icon.act-features { background: rgba(139, 255, 34, 0.12); }
.ai-cl-action-icon.act-agenda { background: rgba(96, 165, 250, 0.12); }

.ai-cl-card-meta {
    flex: 1;
    min-width: 0;
}

.ai-cl-card-action-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e0f5e0;
    text-transform: capitalize;
}

.ai-cl-card-event-title {
    font-size: 0.72rem;
    color: rgba(192, 232, 208, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-cl-card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ai-cl-card-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(139, 255, 34, 0.1);
    background: rgba(13, 79, 79, 0.3);
    color: rgba(192, 232, 208, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.15s;
}

.ai-cl-card-btn:hover {
    border-color: rgba(139, 255, 34, 0.3);
    color: #8BFF22;
    background: rgba(139, 255, 34, 0.08);
}

.ai-cl-card-btn.is-fav {
    color: #eab308;
    border-color: rgba(234, 179, 8, 0.3);
}

.ai-cl-card-score {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}

.ai-cl-card-score.score-high { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.ai-cl-card-score.score-mid { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.ai-cl-card-score.score-low { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.ai-cl-card-time {
    font-size: 0.7rem;
    color: rgba(192, 232, 208, 0.3);
    flex-shrink: 0;
}

/* Content body — displayed text/variants */
.ai-cl-card-body {
    margin-top: 8px;
}

.ai-cl-highlight-text {
    font-size: 0.92rem;
    color: #e0f5e0;
    line-height: 1.5;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border-left: 3px solid rgba(139, 255, 34, 0.3);
    margin-bottom: 8px;
}

.ai-cl-highlight-text em {
    color: #8BFF22;
    font-style: normal;
    font-weight: 600;
}

/* Trendy title variants */
.ai-cl-variants {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-cl-variant {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.ai-cl-variant:hover {
    background: rgba(139, 255, 34, 0.03);
    border-left-color: rgba(139, 255, 34, 0.3);
}

.ai-cl-variant-score {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    min-width: 45px;
    text-align: center;
}

.ai-cl-variant-score.vs-high { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.ai-cl-variant-score.vs-mid { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.ai-cl-variant-score.vs-low { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.ai-cl-variant-content {
    flex: 1;
    min-width: 0;
}

.ai-cl-variant-title {
    font-size: 0.88rem;
    color: #e0f5e0;
    font-weight: 600;
    margin-bottom: 3px;
}

.ai-cl-variant-strategy {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-bottom: 3px;
}

.ai-cl-variant-strategy.str-seo { color: #f59e0b; }
.ai-cl-variant-strategy.str-curiosity { color: #ec4899; }
.ai-cl-variant-strategy.str-social { color: #60a5fa; }
.ai-cl-variant-strategy.str-trend { color: #8BFF22; }
.ai-cl-variant-strategy.str-creative { color: #a855f7; }

.ai-cl-variant-rationale {
    font-size: 0.78rem;
    color: rgba(192, 232, 208, 0.45);
    line-height: 1.4;
}

/* Tags / Trend signals */
.ai-cl-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.ai-cl-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(139, 255, 34, 0.08);
    color: rgba(192, 232, 208, 0.6);
    border: 1px solid rgba(139, 255, 34, 0.1);
}

.ai-cl-tag.tag-trend {
    background: rgba(236, 72, 153, 0.08);
    color: #ec4899;
    border-color: rgba(236, 72, 153, 0.15);
}

.ai-cl-tag.tag-seo {
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.15);
}

/* ========================================
   KEYWORD CLOUD (Trends tab)
======================================== */
.ai-cl-keyword-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 20px 10px;
}

.ai-cl-keyword {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
    background: rgba(139, 255, 34, 0.06);
    color: #8BFF22;
    border: 1px solid rgba(139, 255, 34, 0.12);
    transition: all 0.2s;
    cursor: default;
}

.ai-cl-keyword:hover {
    background: rgba(139, 255, 34, 0.12);
    border-color: rgba(139, 255, 34, 0.3);
    transform: scale(1.05);
}

.ai-cl-keyword .kw-count {
    font-size: 0.65rem;
    opacity: 0.5;
    font-weight: 400;
}

/* Keyword sizes (based on frequency) */
.ai-cl-keyword.kw-xl { font-size: 1.1rem; padding: 8px 18px; }
.ai-cl-keyword.kw-lg { font-size: 0.95rem; padding: 7px 16px; }
.ai-cl-keyword.kw-md { font-size: 0.82rem; }
.ai-cl-keyword.kw-sm { font-size: 0.72rem; padding: 4px 10px; opacity: 0.8; }

/* ========================================
   CHART CONTAINERS
======================================== */
.ai-cl-chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.ai-cl-chart-card {
    background: rgba(13, 79, 79, 0.2);
    border: 1px solid rgba(139, 255, 34, 0.06);
    border-radius: 12px;
    padding: 16px;
}

.ai-cl-chart-card h4 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #e0f5e0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-cl-chart-wrap {
    position: relative;
    height: 220px;
}

.ai-cl-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ========================================
   TOP SCORED (Scores tab)
======================================== */
.ai-cl-top-scored {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.ai-cl-scored-card {
    background: rgba(13, 79, 79, 0.2);
    border: 1px solid rgba(139, 255, 34, 0.08);
    border-radius: 10px;
    padding: 14px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}

.ai-cl-scored-card:hover {
    border-color: rgba(139, 255, 34, 0.2);
}

.ai-cl-scored-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.ai-cl-scored-card.rank-1::before { background: linear-gradient(90deg, #eab308, #f59e0b); }
.ai-cl-scored-card.rank-2::before { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.ai-cl-scored-card.rank-3::before { background: linear-gradient(90deg, #b45309, #d97706); }

.ai-cl-scored-rank {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 1.2rem;
    opacity: 0.3;
}

.ai-cl-scored-score {
    font-size: 1.8rem;
    font-weight: 700;
    color: #8BFF22;
    margin-bottom: 4px;
}

.ai-cl-scored-score span {
    font-size: 0.7rem;
    color: rgba(192, 232, 208, 0.4);
    font-weight: 400;
}

.ai-cl-scored-text {
    font-size: 0.88rem;
    color: #e0f5e0;
    line-height: 1.4;
    margin-bottom: 6px;
}

.ai-cl-scored-meta {
    font-size: 0.72rem;
    color: rgba(192, 232, 208, 0.35);
}

/* ========================================
   FAVORITES TAB
======================================== */
.ai-cl-favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

/* ========================================
   APPLIED RATIO BAR
======================================== */
.ai-cl-applied-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(13, 79, 79, 0.2);
    border-radius: 10px;
    margin-bottom: 16px;
}

.ai-cl-applied-label {
    font-size: 0.78rem;
    color: rgba(192, 232, 208, 0.5);
    white-space: nowrap;
}

.ai-cl-applied-track {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 5px;
    overflow: hidden;
}

.ai-cl-applied-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s ease;
}

.ai-cl-applied-fill.fill-applied {
    background: linear-gradient(90deg, #8BFF22, #22c55e);
}

.ai-cl-applied-fill.fill-fav {
    background: linear-gradient(90deg, #eab308, #f59e0b);
}

.ai-cl-applied-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: #8BFF22;
    min-width: 40px;
    text-align: right;
}

/* ========================================
   EMPTY / LOADING
======================================== */
.ai-cl-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    gap: 12px;
}

.ai-cl-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(139, 255, 34, 0.1);
    border-top-color: #8BFF22;
    border-radius: 50%;
    animation: ai-cl-spin 0.8s linear infinite;
}

@keyframes ai-cl-spin {
    to { transform: rotate(360deg); }
}

.ai-cl-loading-text {
    color: rgba(192, 232, 208, 0.4);
    font-size: 0.85rem;
}

.ai-cl-empty {
    text-align: center;
    padding: 40px 20px;
}

.ai-cl-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.4;
}

.ai-cl-empty-text {
    color: rgba(192, 232, 208, 0.4);
    font-size: 0.9rem;
}

.ai-cl-empty-sub {
    color: rgba(192, 232, 208, 0.25);
    font-size: 0.78rem;
    margin-top: 4px;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 1200px) {
    .ai-cl-chart-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ai-cl-overview-strip {
        gap: 6px;
    }

    .ai-cl-mini-stat {
        min-width: 80px;
    }

    .ai-cl-tab-bar {
        overflow-x: auto;
    }

    .ai-cl-top-scored,
    .ai-cl-favorites-grid {
        grid-template-columns: 1fr;
    }

    .ai-cl-content-card {
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .ai-cl-overview-strip {
        flex-direction: column;
    }

    .ai-content-lab-controls {
        flex-direction: column;
        align-items: stretch;
    }
}
