/* ═══════════════════════════════════════════════════════════════
   BLOG VISUAL COMPONENTS - Neobrutalist Style
   Rich visual elements for enhanced article engagement
   Del.GG - Polished Version
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─── */
:root {
    --blog-primary: #7C3AED;
    --blog-primary-light: #A78BFA;
    --blog-success: #059669;
    --blog-danger: #DC2626;
    --blog-warning: #D97706;
    --blog-border: #000;
    --blog-shadow: 4px 4px 0 #000;
    --blog-shadow-hover: 6px 6px 0 #000;
    --blog-radius: 8px;
    --blog-transition: 0.2s ease;
}

/* ─── CALLOUT BOXES ─── */
.callout-box {
    background: #FEF3C7;
    border: 3px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 20px 24px;
    margin: 24px 0;
    box-shadow: var(--blog-shadow);
    transition: transform var(--blog-transition), box-shadow var(--blog-transition);
}

.callout-box:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--blog-shadow-hover);
}

.callout-box.info {
    background: #DBEAFE;
    border-left: 6px solid #3B82F6;
}

.callout-box.success {
    background: #D1FAE5;
    border-left: 6px solid var(--blog-success);
}

.callout-box.warning {
    background: #FEF3C7;
    border-left: 6px solid var(--blog-warning);
}

.callout-box.danger {
    background: #FEE2E2;
    border-left: 6px solid var(--blog-danger);
}

.callout-box .callout-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.callout-box .callout-content {
    font-size: 0.95rem;
    line-height: 1.7;
}

.callout-box .callout-content ul,
.callout-box .callout-content ol {
    margin: 12px 0;
    padding-left: 20px;
}

.callout-box .callout-content li {
    margin: 6px 0;
}

/* ─── COMPARISON TABLES ─── */
.comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 3px solid var(--blog-border);
    border-radius: var(--blog-radius);
    overflow: hidden;
    margin: 24px 0;
    box-shadow: var(--blog-shadow);
}

.comparison-table th {
    background: #000;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    padding: 16px;
    text-align: left;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.comparison-table td {
    padding: 14px 16px;
    border-bottom: 2px solid #E5E7EB;
    background: #fff;
    vertical-align: top;
    line-height: 1.5;
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table tr:nth-child(even) td {
    background: #F9FAFB;
}

.comparison-table tr:hover td {
    background: #F3E8FF;
}

.comparison-table .check {
    color: var(--blog-success);
    font-weight: 700;
}

.comparison-table .check::before {
    content: '✓ ';
}

.comparison-table .cross {
    color: var(--blog-danger);
    font-weight: 700;
}

.comparison-table .cross::before {
    content: '✗ ';
}

/* ─── STAT CARDS ─── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.stat-card {
    background: #fff;
    border: 3px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 20px 16px;
    text-align: center;
    box-shadow: var(--blog-shadow);
    transition: transform var(--blog-transition), box-shadow var(--blog-transition);
}

.stat-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--blog-shadow-hover);
}

.stat-card .stat-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--blog-primary);
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #555;
    margin-top: 6px;
    line-height: 1.3;
    font-weight: 500;
}

/* ─── PROGRESS BARS ─── */
.progress-bar-container {
    margin: 16px 0;
}

.progress-bar-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    gap: 12px;
}

.progress-bar-label span:last-child {
    color: #666;
    font-size: 0.85rem;
    text-align: right;
    flex-shrink: 0;
}

.progress-bar {
    height: 26px;
    background: #E5E7EB;
    border: 2px solid var(--blog-border);
    border-radius: 13px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blog-primary), var(--blog-primary-light));
    border-radius: 11px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 11px 11px 0 0;
}

/* ─── TIMELINE ─── */
.timeline {
    position: relative;
    margin: 32px 0;
    padding-left: 36px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 9px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    background: linear-gradient(180deg, var(--blog-primary), var(--blog-primary-light));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
    padding: 18px 22px;
    background: #fff;
    border: 3px solid var(--blog-border);
    border-radius: var(--blog-radius);
    box-shadow: var(--blog-shadow);
    transition: transform var(--blog-transition), box-shadow var(--blog-transition);
}

.timeline-item:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--blog-shadow-hover);
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -36px;
    top: 22px;
    width: 18px;
    height: 18px;
    background: var(--blog-primary);
    border: 3px solid var(--blog-border);
    border-radius: 50%;
    box-shadow: 0 0 0 4px #fff;
}

.timeline-item .timeline-date {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--blog-primary);
    font-size: 0.9rem;
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

.timeline-item .timeline-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.timeline-item p {
    margin: 0;
    color: #555;
    line-height: 1.5;
}

/* ─── ACCORDION ─── */
.accordion {
    margin: 24px 0;
    border: 3px solid var(--blog-border);
    border-radius: var(--blog-radius);
    overflow: hidden;
    box-shadow: var(--blog-shadow);
}

.accordion-item {
    border-bottom: 3px solid var(--blog-border);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    background: #fff;
    padding: 18px 22px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: background var(--blog-transition);
    user-select: none;
}

.accordion-header:hover {
    background: #F9FAFB;
}

.accordion-header::after {
    content: '+';
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--blog-primary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.accordion-item.active .accordion-header {
    background: #F3E8FF;
}

.accordion-item.active .accordion-header::after {
    transform: rotate(45deg);
}

.accordion-content {
    display: none;
    padding: 0 22px 22px;
    background: #fff;
    line-height: 1.6;
}

.accordion-content ul,
.accordion-content ol {
    margin: 12px 0;
    padding-left: 20px;
}

.accordion-content li {
    margin: 8px 0;
}

.accordion-item.active .accordion-content {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── QUIZ WIDGET ─── */
.quiz-widget {
    background: #fff;
    border: 3px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 24px;
    margin: 24px 0;
    box-shadow: var(--blog-shadow);
}

.quiz-widget .quiz-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.quiz-option {
    display: block;
    padding: 14px 18px;
    margin: 10px 0;
    background: #F9FAFB;
    border: 2px solid var(--blog-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--blog-transition);
    font-size: 0.95rem;
    line-height: 1.4;
}

.quiz-option:hover {
    background: #E5E7EB;
    transform: translateX(4px);
    border-color: var(--blog-primary);
}

.quiz-option.correct {
    background: #D1FAE5;
    border-color: var(--blog-success);
    border-width: 3px;
}

.quiz-option.correct::before {
    content: '✓ ';
    color: var(--blog-success);
    font-weight: bold;
}

.quiz-option.incorrect {
    background: #FEE2E2;
    border-color: var(--blog-danger);
    border-width: 3px;
}

.quiz-option.incorrect::before {
    content: '✗ ';
    color: var(--blog-danger);
    font-weight: bold;
}

.quiz-result {
    margin-top: 16px;
    padding: 14px 18px;
    border-radius: 6px;
    font-weight: 600;
    display: none;
}

.quiz-result.show {
    display: block;
}

/* ─── CALCULATOR WIDGET ─── */
.calculator-widget {
    background: linear-gradient(135deg, var(--blog-primary) 0%, var(--blog-primary-light) 100%);
    border: 3px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 28px;
    margin: 24px 0;
    box-shadow: var(--blog-shadow);
    color: #fff;
}

.calculator-widget .calc-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 20px;
}

.calculator-widget label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.calculator-widget input {
    width: 100%;
    padding: 14px;
    margin-bottom: 14px;
    border: 3px solid var(--blog-border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color var(--blog-transition);
}

.calculator-widget input:focus {
    outline: none;
    border-color: var(--blog-primary);
}

.calculator-widget .calc-btn {
    width: 100%;
    padding: 16px;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: transform var(--blog-transition), background var(--blog-transition);
}

.calculator-widget .calc-btn:hover {
    transform: translateY(-2px);
    background: #222;
}

.calculator-widget .calc-btn:active {
    transform: translateY(0);
}

.calculator-widget .calc-result {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(4px);
}

.calculator-widget .calc-result-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
}

/* ─── CHART CONTAINERS ─── */
.chart-container {
    background: #fff;
    border: 3px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 28px;
    margin: 24px 0;
    box-shadow: var(--blog-shadow);
}

.chart-container .chart-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 20px;
    text-align: center;
}

/* CSS Bar Chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 200px;
    padding: 20px 10px 40px;
    border-bottom: 3px solid var(--blog-border);
    margin-bottom: 10px;
}

.bar-chart .bar {
    width: 48px;
    background: linear-gradient(180deg, var(--blog-primary), var(--blog-primary-light));
    border: 2px solid var(--blog-border);
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: height 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar-chart .bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 4px 4px 0 0;
}

.bar-chart .bar-label {
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    color: #555;
}

.bar-chart .bar-value {
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--blog-primary);
    white-space: nowrap;
}

/* ─── INFOGRAPHIC STEPS ─── */
.infographic-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin: 24px 0;
}

.infographic-step {
    flex: 1;
    min-width: 180px;
    background: #fff;
    border: 3px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 24px 18px 20px;
    text-align: center;
    box-shadow: var(--blog-shadow);
    position: relative;
    transition: transform var(--blog-transition), box-shadow var(--blog-transition);
}

.infographic-step:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--blog-shadow-hover);
}

.infographic-step .step-number {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--blog-primary);
    color: #fff;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 15px;
    border: 3px solid var(--blog-border);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.infographic-step .step-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
    line-height: 1;
}

.infographic-step .step-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
    line-height: 1.3;
}

.infographic-step .step-desc {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
}

/* ─── KEY TAKEAWAYS BOX ─── */
.key-takeaways {
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
    border: 3px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 28px;
    margin: 32px 0;
    box-shadow: var(--blog-shadow);
}

.key-takeaways .takeaway-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.key-takeaways ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-takeaways li {
    padding: 10px 0 10px 32px;
    position: relative;
    line-height: 1.5;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.key-takeaways li:last-child {
    border-bottom: none;
}

.key-takeaways li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 10px;
    color: var(--blog-success);
    font-weight: bold;
    font-size: 1.1rem;
}

/* ─── POLL WIDGET ─── */
.poll-widget {
    background: #fff;
    border: 3px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 24px;
    margin: 24px 0;
    box-shadow: var(--blog-shadow);
}

.poll-widget .poll-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 18px;
}

.poll-option {
    margin: 14px 0;
}

.poll-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.95rem;
}

.poll-option-header span:last-child {
    color: var(--blog-primary);
    font-weight: 700;
}

.poll-option-bar {
    height: 32px;
    background: #E5E7EB;
    border: 2px solid var(--blog-border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--blog-transition);
}

.poll-option-bar:hover {
    transform: scale(1.01);
}

.poll-option-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--blog-primary), var(--blog-primary-light));
    display: flex;
    align-items: center;
    padding-left: 14px;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── ARTICLE SOURCES ─── */
.article-sources {
    background: #F3F4F6;
    border: 3px solid var(--blog-border);
    border-radius: var(--blog-radius);
    padding: 24px;
    margin: 40px 0 24px;
    box-shadow: var(--blog-shadow);
}

.article-sources .sources-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 14px;
}

.article-sources ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-sources li {
    padding: 8px 0 8px 24px;
    font-size: 0.9rem;
    color: #555;
    position: relative;
}

.article-sources li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--blog-primary);
    font-weight: 600;
}

.article-sources a {
    color: var(--blog-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--blog-transition);
}

.article-sources a:hover {
    text-decoration: underline;
    color: var(--blog-primary-light);
}

/* ─── BLOCKQUOTE ENHANCEMENT ─── */
blockquote {
    background: #F9FAFB;
    border: 3px solid var(--blog-border);
    border-left: 6px solid var(--blog-primary);
    border-radius: var(--blog-radius);
    padding: 24px 28px;
    margin: 24px 0;
    box-shadow: var(--blog-shadow);
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.6;
}

blockquote cite {
    display: block;
    margin-top: 12px;
    font-style: normal;
    font-weight: 600;
    color: var(--blog-primary);
    font-size: 0.95rem;
}

/* ─── RESPONSIVE STYLES ─── */
@media (max-width: 768px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px 12px;
    }

    .stat-card .stat-number {
        font-size: 1.6rem;
    }

    .infographic-steps {
        flex-direction: column;
        gap: 20px;
    }

    .infographic-step {
        min-width: unset;
    }

    .comparison-table {
        font-size: 0.85rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 12px 14px;
    }

    .bar-chart {
        height: 160px;
        padding: 15px 5px 35px;
    }

    .bar-chart .bar {
        width: 32px;
    }

    .bar-chart .bar-label {
        font-size: 0.7rem;
    }

    .bar-chart .bar-value {
        font-size: 0.75rem;
    }

    .timeline {
        padding-left: 28px;
    }

    .timeline-item::before {
        left: -28px;
        width: 14px;
        height: 14px;
    }

    .timeline-item {
        padding: 16px 18px;
    }

    .accordion-header,
    .accordion-content {
        padding-left: 18px;
        padding-right: 18px;
    }

    .calculator-widget,
    .chart-container,
    .key-takeaways {
        padding: 20px;
    }

    .callout-box {
        padding: 18px 20px;
    }

    .poll-option-fill {
        font-size: 0.75rem;
        padding-left: 10px;
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card .stat-number {
        font-size: 1.4rem;
    }

    .stat-card .stat-label {
        font-size: 0.75rem;
    }

    .progress-bar-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .progress-bar-label span:last-child {
        text-align: left;
        font-size: 0.8rem;
    }
}

/* ─── PRINT STYLES ─── */
@media print {

    .callout-box,
    .stat-card,
    .timeline-item,
    .accordion,
    .quiz-widget,
    .calculator-widget,
    .chart-container,
    .infographic-step,
    .key-takeaways,
    .poll-widget,
    .article-sources {
        box-shadow: none;
        border-width: 1px;
    }

    .accordion-content {
        display: block !important;
    }
}