/**
 * Minimal Ideas - Custom Styles
 * Colorful, playful theme for community engagement
 */

/* ==================== Color Variables ==================== */
:root {
    --primary-gradient-start: #6366f1;
    --primary-gradient-end: #8b5cf6;
    --accent-orange: #f59e0b;
    --success-green: #10b981;
    --info-blue: #3b82f6;
    --warning-yellow: #fbbf24;
    --danger-red: #ef4444;
    --light-gray: #f3f4f6;
    --border-gray: #e5e7eb;
    --text-gray: #6b7280;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* ==================== Global Styles ==================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #fafafa;
    color: #1f2937;
}

/* ==================== Brand & Gradients ==================== */
.brand-gradient {
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.3));
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    color: white;
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.4);
    color: white;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==================== Cards ==================== */
.suggestion-card {
    border-radius: 12px;
    border: 1px solid var(--border-gray);
    background: white;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    min-height: 288px;
}

.suggestion-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-gradient-start);
}

.suggestion-card .card-body {
    padding: 1.5rem;
}

/* ==================== Badges ==================== */
.badge {
    padding: 0.4em 0.8em;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-type-feature {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.badge-type-bug {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.badge-type-improvement {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-component {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.badge-status-under_review {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.badge-status-planned {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.badge-status-in_progress {
    background: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
}

.badge-status-completed {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.badge-status-duplicate {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
}

.badge-priority-high {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-priority-quick_win {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-priority-breaking {
    background: rgba(220, 38, 38, 0.15);
    color: #991b1b;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

/* ==================== Vote Button ==================== */
.vote-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 2px solid var(--border-gray);
    background: white;
    color: var(--text-gray);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.vote-button:hover {
    border-color: var(--primary-gradient-start);
    color: var(--primary-gradient-start);
    transform: scale(1.05);
}

.vote-button.voted {
    border-color: var(--primary-gradient-start);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-gradient-start);
}

.vote-button.voted .vote-icon {
    animation: heartbeat 0.5s ease;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.3); }
    50% { transform: scale(1.1); }
}

.vote-count {
    font-size: 1.1em;
}

/* ==================== Reactions ==================== */
.reaction-picker {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.reaction-btn {
    font-size: 1.5rem;
    padding: 0.4rem 0.6rem;
    border: 2px solid transparent;
    border-radius: 8px;
    background: var(--light-gray);
    cursor: pointer;
    transition: all 0.2s ease;
}

.reaction-btn:hover {
    transform: scale(1.2);
    background: white;
    border-color: var(--primary-gradient-start);
}

.reaction-btn.reacted {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-gradient-start);
}

.reaction-summary {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.reaction-count {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    background: var(--light-gray);
    font-size: 0.9rem;
}

.reaction-count .emoji {
    font-size: 1.2rem;
}

/* ==================== Comments ==================== */
.comment-thread {
    border-left: 3px solid var(--light-gray);
    padding-left: 1rem;
    margin-left: 0.5rem;
}

.comment-card {
    border-radius: 8px;
    border: 1px solid var(--border-gray);
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
}

.comment-card.pinned {
    border-color: var(--accent-orange);
    background: rgba(245, 158, 11, 0.05);
}

.comment-card.official {
    border-left: 4px solid var(--primary-gradient-start);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.comment-author .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-gradient-start);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.comment-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}

.comment-reply {
    margin-left: 2rem;
    margin-top: 0.5rem;
}

/* ==================== Filters ==================== */
.filter-bar {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-label {
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.9rem;
}

.filter-checkbox {
    margin-right: 0.3rem;
}

/* ==================== Collapsible Filters Sidebar ==================== */

/* Main sidebar container */
.filters-sidebar-wrapper {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: calc(100vh - 200px);
}

/* Slim collapsed state */
.filters-sidebar-wrapper.collapsed {
    flex: 0 0 60px;
    max-width: 60px;
}

.filters-sidebar-wrapper.collapsed .filter-bar {
    display: none;
}

/* Slim vertical bar when collapsed */
.filter-slim-bar {
    display: none;
    position: sticky;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    border-radius: 0 12px 12px 0;
    padding: 2rem 0.5rem;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: -15px;
}

.filters-sidebar-wrapper.collapsed .filter-slim-bar {
    display: flex;
}

.filter-slim-bar:hover {
    background: linear-gradient(135deg, #5558e3, #7c4ee6);
    box-shadow: var(--shadow-lg);
}

.filter-slim-bar .icon {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.filter-slim-bar .text {
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Full filter bar */
.filter-bar {
    position: sticky;
    top: 100px;
}

/* Collapse button inside filter bar */
.filter-collapse-btn {
    background: transparent;
    border: 2px solid var(--primary-gradient-start);
    color: var(--primary-gradient-start);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.filter-collapse-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(-2px);
}

/* Main content area adjustments */
.main-content-area {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    max-width: 100%;
}

/* ==================== Tables ==================== */
.table-suggestion {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table-suggestion thead {
    background: var(--light-gray);
}

.table-suggestion tbody tr {
    transition: background 0.2s ease;
    cursor: pointer;
}

.table-suggestion tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.table-suggestion td, .table-suggestion th {
    padding: 1rem;
    vertical-align: middle;
}

.table-suggestion th {
    font-weight: 600;
    white-space: nowrap;
}

.table-suggestion td .badge {
    white-space: nowrap;
}

.table-suggestion td strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== Roadmap Kanban ==================== */
.roadmap-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.roadmap-column {
    background: var(--light-gray);
    border-radius: 12px;
    padding: 1rem;
    min-height: 400px;
}

.roadmap-column-header {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.roadmap-column-count {
    font-size: 0.9rem;
    color: var(--text-gray);
    background: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.roadmap-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: all 0.2s ease;
}

.roadmap-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.roadmap-card:active {
    cursor: grabbing;
}

/* ==================== Forms ==================== */
.form-control:focus {
    border-color: var(--primary-gradient-start);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

.markdown-editor {
    min-height: 300px;
    font-family: monospace;
}

.markdown-preview {
    border: 1px solid var(--border-gray);
    border-radius: 8px;
    padding: 1rem;
    min-height: 300px;
    background: white;
}

/* ==================== Utility Classes ==================== */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.border-gradient {
    border: 2px solid transparent;
    background-image: linear-gradient(white, white),
                      linear-gradient(135deg, var(--primary-gradient-start), var(--primary-gradient-end));
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.icon-lg {
    font-size: 1.5rem;
}

.icon-xl {
    font-size: 2rem;
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .roadmap-board {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        padding: 1rem;
    }

    .suggestion-card .card-body {
        padding: 1rem;
    }

    .table-suggestion {
        font-size: 0.9rem;
    }
}

/* ==================== Loading States ==================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== Empty States ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--text-gray);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.empty-state-text {
    color: var(--text-gray);
    font-size: 1.1rem;
}

/* ==================== Code Highlighting (Pygments) ==================== */
.highlight {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    border: 1px solid var(--border-gray);
}

.highlight pre {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

.highlight .c { color: #6a737d; } /* Comment */
.highlight .k { color: #d73a49; font-weight: bold; } /* Keyword */
.highlight .s { color: #032f62; } /* String */
.highlight .n { color: #24292e; } /* Name */
.highlight .nf { color: #6f42c1; } /* Function */
.highlight .nc { color: #6f42c1; font-weight: bold; } /* Class */
.highlight .mi { color: #005cc5; } /* Number */
.highlight .o { color: #d73a49; } /* Operator */

/* ==================== Markdown Content ==================== */
.suggestion-description,
.comment-content {
    line-height: 1.7;
    color: #1f2937;
}

.suggestion-description h1,
.suggestion-description h2,
.suggestion-description h3,
.comment-content h1,
.comment-content h2,
.comment-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.suggestion-description h1,
.comment-content h1 {
    font-size: 1.75rem;
    border-bottom: 2px solid var(--border-gray);
    padding-bottom: 0.5rem;
}

.suggestion-description h2,
.comment-content h2 {
    font-size: 1.5rem;
}

.suggestion-description h3,
.comment-content h3 {
    font-size: 1.25rem;
}

.suggestion-description p,
.comment-content p {
    margin-bottom: 1rem;
}

.suggestion-description ul,
.suggestion-description ol,
.comment-content ul,
.comment-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.suggestion-description li,
.comment-content li {
    margin-bottom: 0.5rem;
}

.suggestion-description blockquote,
.comment-content blockquote {
    border-left: 4px solid var(--primary-gradient-start);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-gray);
    font-style: italic;
}

.suggestion-description code,
.comment-content code {
    background: var(--light-gray);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.suggestion-description table,
.comment-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.suggestion-description th,
.suggestion-description td,
.comment-content th,
.comment-content td {
    border: 1px solid var(--border-gray);
    padding: 0.5rem;
}

.suggestion-description th,
.comment-content th {
    background: var(--light-gray);
    font-weight: 600;
}

/* ==================== Inline Feedback Animations ==================== */

/* Success checkmark animation for vote button */
@keyframes checkmark {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 1; }
    100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

/* Pulse animation for buttons */
@keyframes button-pulse {
    0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0); }
    100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

/* Slide-in animation for inline feedback */
@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Vote button feedback states */
.vote-button.feedback-success {
    animation: button-pulse 0.6s ease;
}

.vote-button .feedback-icon {
    display: none;
    margin-left: 0.25rem;
    animation: checkmark 0.5s ease;
}

.vote-button.show-feedback .feedback-icon {
    display: inline-block;
}

/* Subscribe button feedback */
.subscribe-button.feedback-success {
    animation: button-pulse 0.6s ease;
}

/* Bottom snackbar enhanced styling */
#votingToast {
    min-width: 300px;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#votingToast .toast-body {
    padding: 0.75rem 1rem;
    font-weight: 500;
}
