/**
 * Idea Board Styles
 * Developer Idea Management Dashboard
 *
 * Layout: Left sidebar with categories + Main area with idea cards
 * Design: Glassmorphism, consistent with Expertaizer design system
 */

/* ============================================================================
   CONTAINER & LAYOUT
   ============================================================================ */

#idea-board-window {
    position: fixed;
    display: none;
    width: 1400px;
    height: 900px;
    max-width: 98vw;
    max-height: 95vh;
    min-width: 900px;
    min-height: 700px;
    z-index: calc(var(--z-fullscreen) - 1);

    /* Standardised Glassmorphism (BIF-Style bluish theme) */
    background: rgba(10, 15, 25, 0.96);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(var(--color-primary-rgb, 0, 183, 255), 0.25);
    border-top: 1px solid rgba(var(--color-primary-rgb, 0, 183, 255), 0.4);
    border-radius: 12px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.7),
        0 0 30px rgba(var(--color-primary-rgb, 0, 183, 255), 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);

    /* Flexbox layout */
    flex-direction: column;
    overflow: hidden;

    /* Default position - centered */
    left: calc(50% - 700px);
    top: 40px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

#idea-board-window.visible {
    display: flex;
    animation: window-appear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes window-appear {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

#idea-board-window.fullscreen {
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    border: none !important;
}

/* ============================================================================
   HEADER (Unified Header System Support)
   ============================================================================ */

/* Legacy Header styles removed - we use unified-header now */

.idea-board-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle at top left, rgba(var(--color-primary-rgb, 0, 183, 255), 0.05), transparent 600px);
}

/* ============================================================================
   SIDEBAR
   ============================================================================ */

.idea-board-sidebar {
    width: 280px; /* Brighter and wider sidebar */
    min-width: 280px;
    background: rgba(0, 0, 0, 0.25);
    border-right: 1px solid rgba(var(--color-primary-rgb, 0, 183, 255), 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.idea-board-sidebar-header {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.idea-board-sidebar-header h3 {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.idea-board-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.sidebar-section {
    margin-bottom: 16px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 10px 4px;
    margin: 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-weight: 500;
    position: relative;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.2));
    color: #fff;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.sidebar-item .icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
}

.sidebar-item .count {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-item.active .count {
    background: rgba(139, 92, 246, 0.4);
    color: #fff;
}

/* Priority indicators */
.sidebar-item[data-priority="high"] .count {
    background: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.sidebar-item[data-priority="medium"] .count {
    background: rgba(251, 191, 36, 0.3);
    color: #fbbf24;
}

/* ============================================================================
   CONTENT AREA
   ============================================================================ */

.idea-board-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0; /* Standardized to 0, inner containers will handle padding */
    background: radial-gradient(circle at top right, rgba(var(--color-primary-rgb, 0, 183, 255), 0.03), transparent 800px);
}

/* Toolbar */
.idea-board-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
}

.idea-board-search {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.idea-board-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

.idea-board-search input:focus {
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.idea-board-search input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.idea-board-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.toolbar-btn.primary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.6), rgba(139, 92, 246, 0.5));
    border-color: rgba(139, 92, 246, 0.4);
}

.toolbar-btn.primary:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.8), rgba(139, 92, 246, 0.7));
}

.toolbar-btn.ai {
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb, 0, 183, 255), 0.4), rgba(var(--color-primary-rgb, 0, 183, 255), 0.2));
    border-color: rgba(var(--color-primary-rgb, 0, 183, 255), 0.5);
    position: relative;
    overflow: hidden;
}

.toolbar-btn.ai:hover {
    background: linear-gradient(180deg, rgba(var(--color-primary-rgb, 0, 183, 255), 0.5), rgba(var(--color-primary-rgb, 0, 183, 255), 0.3));
    box-shadow: 0 0 20px rgba(var(--color-primary-rgb, 0, 183, 255), 0.3);
}

.toolbar-btn.ai.loading {
    opacity: 0.7;
    pointer-events: none;
}

.toolbar-btn.ai.loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 6px;
}

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

/* Ideas Grid */
.idea-board-grid {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); /* Larger cards */
    gap: 20px;
    align-content: start;
}

/* Empty State */
.idea-board-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.idea-board-empty .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.idea-board-empty h3 {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 8px;
}

.idea-board-empty p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0 0 20px;
}

/* ============================================================================
   IDEA CARDS
   ============================================================================ */

.idea-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px; /* Increased padding */
    display: flex;
    flex-direction: column;
    gap: 14px; /* Increased gap */
    transition: all 0.2s ease;
    cursor: pointer;
    min-height: 200px; /* Ensure a minimum presence */
}

.idea-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(var(--color-primary-rgb, 0, 183, 255), 0.4); /* Use primary color */
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.idea-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.idea-card-icon {
    font-size: 28px; /* Larger icon */
    flex-shrink: 0;
}

.idea-card-title {
    flex: 1;
}

.idea-card-title h4 {
    font-size: 16px; /* Larger title */
    font-weight: 600;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.3;
}

.idea-card-title .source-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.2);
    color: rgba(139, 92, 246, 0.9);
}

.idea-card-title .source-badge.manual {
    background: rgba(59, 130, 246, 0.2);
    color: rgba(96, 165, 250, 0.9);
}

.idea-card-description {
    font-size: 14px; /* Increased font size */
    color: rgba(255, 255, 255, 0.7); /* Slightly brighter */
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* More lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.idea-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.idea-card-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.idea-card-meta .meta-item .icon {
    font-size: 12px;
}

/* Impact bar */
.impact-bar {
    display: flex;
    align-items: center;
    gap: 6px;
}

.impact-bar-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.impact-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

.impact-bar-fill.high {
    background: linear-gradient(90deg, #22c55e, #10b981);
}

.impact-bar-fill.medium {
    background: linear-gradient(90deg, #f59e0b, #eab308);
}

.impact-bar-fill.low {
    background: linear-gradient(90deg, #6b7280, #9ca3af);
}

/* Tags */
.idea-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.idea-tag {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.idea-tag.quick-win {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.idea-tag.ai-feature {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.idea-tag.ux {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
}

.idea-tag.performance {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

/* Card Actions */
.idea-card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.idea-card-actions .action-btn {
    flex: 1;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.idea-card-actions .action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.idea-card-actions .action-btn.park {
    border-color: rgba(251, 191, 36, 0.3);
}

.idea-card-actions .action-btn.park:hover {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.5);
    color: #fbbf24;
}

.idea-card-actions .action-btn.roadmap {
    border-color: rgba(34, 197, 94, 0.3);
}

.idea-card-actions .action-btn.roadmap:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
    color: #22c55e;
}

.idea-card-actions .action-btn.delete {
    border-color: rgba(239, 68, 68, 0.3);
}

.idea-card-actions .action-btn.delete:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

/* Priority indicators on cards */
.idea-card[data-priority="high"] {
    border-left: 3px solid #ef4444;
}

.idea-card[data-priority="critical"] {
    border-left: 3px solid #dc2626;
    background: rgba(239, 68, 68, 0.05);
}

.idea-card[data-priority="medium"] {
    border-left: 3px solid #f59e0b;
}

/* Status indicators */
.idea-card[data-status="parked"] {
    opacity: 0.8;
    border-style: dashed;
}

.idea-card[data-status="planned"] {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.05);
}

.idea-card[data-status="completed"] {
    opacity: 0.6;
    border-color: rgba(34, 197, 94, 0.5);
}

.idea-card[data-status="completed"]::after {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    background: rgba(34, 197, 94, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
}

/* ============================================================================
   NEW IDEA FORM
   ============================================================================ */

.idea-form-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000; /* Extremely high to stay in front of parent windows (70k+) */
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.idea-form-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.idea-form {
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 24px;
    width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.idea-form h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.idea-form-group {
    margin-bottom: 16px;
}

.idea-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.idea-form-group input,
.idea-form-group textarea,
.idea-form-group select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.idea-form-group input:focus,
.idea-form-group textarea:focus,
.idea-form-group select:focus {
    border-color: rgba(139, 92, 246, 0.5);
}

.idea-form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.idea-form-group select {
    cursor: pointer;
}

.idea-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.idea-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.idea-form-actions button {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.idea-form-actions .cancel-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
}

.idea-form-actions .cancel-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.idea-form-actions .submit-btn {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border: none;
    color: #fff;
}

.idea-form-actions .submit-btn:hover {
    filter: brightness(1.1);
}

/* ============================================================================
   STATS BAR
   ============================================================================ */

.idea-board-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-item .value {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.stat-item.new .value {
    color: #3b82f6;
}

.stat-item.parked .value {
    color: #f59e0b;
}

.stat-item.planned .value {
    color: #22c55e;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    #idea-board-window {
        width: 100vw;
        height: 100vh;
        left: 0 !important;
        top: 0 !important;
        border-radius: 0;
    }

    .idea-board-sidebar {
        width: 60px;
        min-width: 60px;
    }

    .idea-board-sidebar .sidebar-item span:not(.icon):not(.count) {
        display: none;
    }

    .idea-board-sidebar .sidebar-item .count {
        position: absolute;
        top: 4px;
        right: 4px;
        padding: 1px 5px;
        font-size: 9px;
    }

    .idea-board-grid {
        grid-template-columns: 1fr;
    }

    .idea-form-row {
        grid-template-columns: 1fr;
    }
}

/* Sidebar Action Buttons */
.sidebar-action-btn {
    width: 100%;
    margin-bottom: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-action-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: rgba(0, 255, 255, 0.3);
    color: #00ffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar-action-btn:active {
    transform: translateY(0);
}

/* AI Source Tag coloring */
.idea-card[data-source="ai-gpt5"] {
    border-left: 3px solid #ff00ff !important;
}

.idea-card[data-source="ai-gpt5"] .idea-card-header::after {
    content: "GPT-5";
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    background: rgba(255, 0, 255, 0.15);
    color: #ff00ff;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 0, 255, 0.3);
    font-weight: bold;
    letter-spacing: 0.5px;
}

.idea-card[data-source="roadmap"] {
    border-left: 3px solid #00ff00 !important;
}

.idea-card[data-source="roadmap"] .idea-card-header::after {
    content: "ROADMAP";
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 0, 0.2);
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* ============================================================================
   DESCRIPTION BANNER
   ============================================================================ */

.idea-board-desc-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(14, 165, 233, 0.05);
    border-bottom: 1px solid rgba(14, 165, 233, 0.12);
    flex-shrink: 0;
}

.idea-board-desc-icon {
    font-size: 18px;
    line-height: 1.4;
    flex-shrink: 0;
}

.idea-board-desc-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.idea-board-desc-text strong {
    font-size: 11px;
    font-weight: 600;
    color: rgba(14, 165, 233, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.idea-board-desc-text span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}
