/* ===== CSS VARIABLES ===== */
:root {
    /* Light Mode - Highlighter Pro */
    --bg-main: #F8FAFC;
    --bg-panel: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;

    --primary: #6366F1;
    --primary-hover: #4F46E5;

    --status-ok-bg: #DCFCE7;
    --status-ok-text: #15803D;
    --status-warning-bg: #FEF9C3;
    --status-warning-text: #CA8A04;
    --status-error-bg: #FEE2E2;
    --status-error-text: #B91C1C;

    --sidebar-bg: url('../images/sidebar-light.png');
    --main-bg: url('../images/bg-light.png');
}

body.dark {
    /* Dark Mode - Consistent Night */
    --bg-main: #050816;
    --bg-panel: #0F172A;
    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;
    --border-color: #1F2937;

    --primary: #22C55E;
    --primary-hover: #16A34A;

    --status-ok-bg: #22C55E;
    --status-ok-text: #000000;
    --status-warning-bg: #EAB308;
    --status-warning-text: #000000;
    --status-error-bg: #FB7185;
    --status-error-text: #000000;

    --sidebar-bg: #0F172A;
    --main-bg: #050816;
}

/* Dark mode overrides for solid colors */
body.dark .sidebar {
    background-image: none;
    background-color: var(--sidebar-bg);
}

body.dark .main-content {
    background-image: none;
    background-color: var(--main-bg);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== LAYOUT ===== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 270px;
    height: 100vh;
    background-image: var(--sidebar-bg);
    background-size: cover;
    background-position: center;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.company-logo {
    width: 120px;
    height: auto;
    margin-bottom: 12px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: opacity 0.3s ease;
}

.sidebar-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.sidebar-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    background-color: rgba(99, 102, 241, 0.1);
    border-left-color: var(--primary);
}

.nav-item.active {
    background-color: rgba(99, 102, 241, 0.15);
    border-left-color: var(--primary);
    font-weight: 600;
}

.nav-item img {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    opacity: 0.8;
}

.nav-item:hover img {
    opacity: 1;
}

.nav-item-text {
    font-size: 14px;
}

/* Separator after Introduction */
.nav-intro {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.nav-intro::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--primary) 50%,
        transparent
    );
    opacity: 0.3;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.language-selector {
    width: 100%;
}

.language-dropdown {
    width: 100%;
    padding: 10px 12px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 20px;
    padding-right: 36px;
}

.language-dropdown:hover {
    border-color: var(--primary);
}

.language-dropdown:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

body.dark .language-dropdown {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.language-dropdown option {
    background-color: var(--bg-panel);
    color: var(--text-primary);
    padding: 10px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 270px;
    flex: 1;
    min-height: 100vh;
    background-image: var(--main-bg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 40px;
}

/* ===== HEADER ===== */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.content-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.theme-icon {
    font-size: 18px;
}

.theme-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== CONTENT CARD ===== */
.content-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.module-intro {
    margin-bottom: 32px;
}

.module-intro h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.module-intro p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== MODULE SECTIONS ===== */
.module-section {
    margin-bottom: 28px;
}

.module-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.module-section ul {
    list-style: none;
    padding-left: 0;
}

.module-section li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

/* Default (LTR languages) */
.module-section li {
    padding-left: 24px;
    padding-right: 0;
}

.module-section li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

/* Arabic (RTL) – arrows on the right */
html[lang="ar"] .module-section li {
    padding-left: 0;
    padding-right: 24px;
}

html[lang="ar"] .module-section li::before {
    content: "←";
    left: auto;
    right: 0;
}

/* ===== STATUS BADGES ===== */
.status-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.status-ok {
    background-color: var(--status-ok-bg);
    color: var(--status-ok-text);
}

.status-warning {
    background-color: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.status-error {
    background-color: var(--status-error-bg);
    color: var(--status-error-text);
}

/* ===== FEATURE GRID ===== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.feature-item {
    padding: 20px;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.feature-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.feature-item h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.feature-item p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== BENEFITS LIST ===== */
.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background-color: var(--bg-main);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.benefit-icon {
    font-size: 20px;
    margin-top: 2px;
}

.benefit-text {
    flex: 1;
}

.benefit-text strong {
    color: var(--text-primary);
    font-size: 15px;
    display: block;
    margin-bottom: 4px;
}

.benefit-text span {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ===== DEMO STYLES ===== */

/* Demo Button */
.demo-button {
    margin-top: 20px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.demo-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

body.dark .demo-button {
    background: linear-gradient(135deg, var(--primary) 0%, #16A34A 100%);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

body.dark .demo-button:hover {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

/* Demo Container */
.demo-container {
    margin-top: 24px;
    padding: 24px;
    background: var(--bg-main);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.demo-container[style*="display: block"] {
    opacity: 1;
}

/* Upload Area */
.demo-upload-area {
    text-align: center;
    padding: 48px 24px;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.demo-upload-area:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.demo-upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.demo-upload-area p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.demo-upload-btn {
    padding: 10px 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.demo-upload-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Progress Bar */
.demo-progress {
    padding: 24px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.demo-progress[style*="display: block"] {
    opacity: 1;
}

.demo-progress-label {
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 12px;
    text-align: center;
}

.demo-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.demo-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
    border-radius: 4px;
    transition: width 0.3s ease;
}

body.dark .demo-progress-fill {
    background: linear-gradient(90deg, var(--primary), #16A34A);
}

/* Demo Results */
.demo-results {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.demo-results[style*="display: block"] {
    opacity: 1;
}

.demo-results h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.demo-result-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demo-result-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-panel);
    border-radius: 8px;
    border-left: 4px solid;
    transition: all 0.3s ease;
    animation: slideIn 0.5s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.demo-result-item.demo-result-error {
    border-left-color: var(--status-error-bg);
}

.demo-result-item.demo-result-warning {
    border-left-color: var(--status-warning-bg);
}

.demo-result-item.demo-result-ok {
    border-left-color: var(--status-ok-bg);
}

.demo-result-icon {
    font-size: 20px;
    margin-top: 2px;
}

.demo-result-content {
    flex: 1;
}

.demo-result-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.demo-result-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.demo-risk-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.demo-risk-badge.demo-risk-high {
    background: var(--status-error-bg);
    color: var(--status-error-text);
}

.demo-risk-badge.demo-risk-medium {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
}

.demo-risk-badge.demo-risk-low {
    background: var(--status-ok-bg);
    color: var(--status-ok-text);
}

/* File Selector */
.demo-file-selector {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.demo-file-box {
    flex: 1;
    padding: 24px;
    background: var(--bg-panel);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    text-align: center;
}

.demo-file-box h5 {
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 14px;
}

.demo-select-btn {
    padding: 8px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.demo-select-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.demo-select-btn.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.demo-vs {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.demo-compare-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.demo-compare-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Form Elements */
.demo-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.demo-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-input-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.demo-input, .demo-select {
    padding: 10px 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.2s;
}

.demo-input:focus, .demo-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.demo-calculate-btn, .demo-generate-dashboard-btn, .demo-generate-report-btn {
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.demo-calculate-btn:hover, .demo-generate-dashboard-btn:hover, .demo-generate-report-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Cost Breakdown */
.demo-cost-summary {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.demo-cost-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-panel);
    border-radius: 8px;
    font-size: 18px;
}

.demo-cost-total strong {
    color: var(--primary);
    font-size: 24px;
}

.demo-cost-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.demo-cost-bar {
    height: 32px;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.demo-cost-item span {
    font-size: 14px;
    color: var(--text-secondary);
}

/* KPI Grid */
.demo-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.demo-kpi-card {
    padding: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
}

.demo-kpi-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.demo-kpi-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.demo-kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.demo-kpi-trend {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
}

/* Charts */
.demo-chart {
    padding: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.demo-chart h5 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 14px;
}

.demo-chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    height: 150px;
}

.demo-chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.demo-chart-bar {
    width: 100%;
    background: var(--primary);
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
}

.demo-chart-bar-wrapper span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Additional Charts */
.demo-additional-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

/* Pie Chart */
.demo-pie-chart {
    padding: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.demo-pie-chart h5 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
}

.demo-pie-chart-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.demo-pie-chart svg {
    width: 200px;
    height: 200px;
    transform: rotate(-90deg);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.demo-pie-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.demo-pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.demo-pie-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.demo-pie-legend-text {
    flex: 1;
    color: var(--text-secondary);
}

.demo-pie-legend-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Line Chart */
.demo-line-chart {
    padding: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.demo-line-chart h5 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
}

.demo-line-chart-content {
    position: relative;
    height: 200px;
}

.demo-line-chart svg {
    width: 100%;
    height: 100%;
}

.demo-line-chart-grid {
    stroke: var(--border-color);
    stroke-width: 1;
    opacity: 0.5;
}

.demo-line-chart-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.demo-line-chart-point {
    fill: var(--primary);
}

.demo-line-chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.demo-line-chart-label {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Progress Bars */
.demo-progress-bars {
    padding: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.demo-progress-bars h5 {
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
}

.demo-progress-bars-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.demo-progress-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.demo-progress-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.demo-progress-bar-label {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
}

.demo-progress-bar-value {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
}

.demo-progress-bar-track {
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.demo-progress-bar-fill-animated {
    height: 100%;
    border-radius: 5px;
    transition: width 1s ease;
}

.demo-progress-bar-fill-animated.color-1 {
    background: linear-gradient(90deg, #6366F1, #818CF8);
}

.demo-progress-bar-fill-animated.color-2 {
    background: linear-gradient(90deg, #22C55E, #4ADE80);
}

.demo-progress-bar-fill-animated.color-3 {
    background: linear-gradient(90deg, #EAB308, #FDE047);
}

.demo-progress-bar-fill-animated.color-4 {
    background: linear-gradient(90deg, #3B82F6, #60A5FA);
}

.demo-progress-bar-fill-animated.color-5 {
    background: linear-gradient(90deg, #A855F7, #C084FC);
}

/* Q&A Assistant */
.demo-qa-input {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.demo-qa-input label {
    font-weight: 500;
    color: var(--text-primary);
}

.demo-textarea {
    padding: 12px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    transition: all 0.2s;
}

.demo-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.demo-ask-btn {
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.demo-ask-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.demo-answer-box {
    padding: 16px;
    background: var(--bg-panel);
    border-radius: 8px;
    margin-bottom: 16px;
    line-height: 1.8;
}

.demo-answer-box p {
    color: var(--text-primary);
    margin: 0;
}

.demo-sources {
    padding: 16px;
    background: var(--bg-main);
    border-radius: 8px;
}

.demo-sources-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.demo-source-item {
    padding: 8px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* Chatbot */
.demo-chat-container {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    height: 500px;
}

.demo-chat-controls {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.demo-chat-start-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.demo-chat-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

body.dark .demo-chat-start-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #16A34A 100%);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

body.dark .demo-chat-start-btn:hover {
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.demo-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.demo-chat-message {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.demo-chat-user {
    justify-content: flex-end;
}

.demo-chat-bot {
    justify-content: flex-start;
}

.demo-chat-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.demo-chat-user .demo-chat-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.demo-chat-bot .demo-chat-bubble {
    background: var(--bg-panel);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.demo-chat-typing-indicator {
    padding: 12px 20px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingAnimation {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Reports */
.demo-report-selector {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.demo-report-selector label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.demo-format-buttons {
    display: flex;
    gap: 12px;
}

.demo-format-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.demo-format-btn:hover {
    border-color: var(--primary);
}

.demo-format-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.demo-report-preview-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
}

.demo-report-icon {
    font-size: 48px;
}

.demo-report-info {
    flex: 1;
}

.demo-report-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.demo-report-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.demo-download-btn {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.demo-download-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
    }

    .content-wrapper {
        padding: 20px;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .demo-file-selector {
        flex-direction: column;
    }

    .demo-vs {
        transform: rotate(90deg);
    }

    .demo-format-buttons {
        flex-wrap: wrap;
    }

    .demo-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .demo-chat-bubble {
        max-width: 85%;
    }
}
/* ===== COOKIE BANNER ===== */

.cookie-content {
    background: var(--bg-panel);
    color: var(--text-primary);
    padding: 24px 28px;
    max-width: 520px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.cookie-content p {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.cookie-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
}

.cookie-btn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.cookie-btn.accept {
    background: var(--primary);
    color: #fff;
}

.cookie-btn.accept:hover {
    background: var(--primary-hover);
}

.cookie-link {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: underline;
}

/* RTL (arabic) */
html[lang="ar"] .cookie-content {
    direction: rtl;
}
/* Zielony kolor ikon w sidebarze */
.sidebar .nav-item img {
    filter: brightness(0) saturate(100%) invert(58%) sepia(84%) saturate(476%) hue-rotate(86deg) brightness(96%) contrast(92%);
}
:root {
    --brand-green: #2ecc71;
    --sidebar-bg: #0b1020; /* Twój ciemny granat/fiolet */
}
.nav-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--brand-green);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nav-icon img {
    width: 20px;
    height: 20px;
    filter: brightness(0) saturate(100%);
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.35);
}
.footer {
    background: radial-gradient(ellipse at top, #0b1224, #050814);
    color: #cbd5e1;
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 3rem;
}

.footer h4 {
    color: #fff;
    margin-bottom: 1rem;
}

.footer a {
    color: #94a3b8;
    text-decoration: none;
}

.footer a:hover {
    color: #22c55e;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo-img {
    height: 36px;
}

.powered-by img {
    max-width: 180px;
    margin-top: 1rem;
    opacity: 0.85;
}

.social-links a {
    font-size: 1.2rem;
    margin-right: 0.75rem;
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
}
html, body {
    height: 100%;
}

body {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.app-container {
    flex: 1; /* <<< TO JEST KLUCZ */
}
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main-scroll {
    flex: 1;
    overflow-y: auto;
}
.contact-highlight {
    color: var(--primary);
}
.module-intro h2 .contact-highlight {
    color: var(--primary) !important;
}
.module-intro h2 .contact-highlight {
    color: var(--primary) !important;
    font-weight: 800;
}
/* Green title ONLY for Contact module */
.module-content[data-module="contact"] .module-intro h2 {
    color: var(--primary);
}
/* CONTACT CTA BUTTON – FINAL FIX */
.contact-button {
    padding: 14px 32px;
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.contact-button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
/* Contact CTA styled like button but using nav logic */
.contact-cta {
    margin-top: 40px;
    justify-content: center;
    border-radius: 10px;
    background: var(--primary);
    color: white !important;
    font-weight: 700;
}

.contact-cta:hover {
    background: var(--primary-hover);
}

.contact-cta .nav-item-text {
    color: white;
    font-size: 16px;
}
/* ===== COOKIE BANNER – NON-BLOCKING ===== */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;

    background: #111827;
    color: #fff;

    display: none; /* pokaże JS */
    align-items: center;
    justify-content: space-between;

    padding: 8px 16px;
    font-size: 13px;
    line-height: 1.4;

    z-index: 1000000;
    pointer-events: auto;
}

.cookie-banner p {
    margin: 0;
}

.cookie-buttons {
    display: flex;
    gap: 8px;
}

.cookie-btn {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.cookie-btn.accept {
    background: #22c55e;
    color: #000;
}

.cookie-btn.reject {
    background: #374151;
    color: #fff;
}
body {
    overflow-y: auto;
}
/* ===== COOKIE MODAL ===== */
.cookie-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000001;
}

.cookie-modal-content {
    background: var(--bg-panel);
    color: var(--text-primary);
    max-width: 720px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    border-radius: 14px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}

.cookie-modal-content h2 {
    margin-bottom: 20px;
}

.cookie-modal-content h3 {
    margin-top: 24px;
    margin-bottom: 10px;
}

.cookie-modal-content h4 {
    margin-top: 16px;
    margin-bottom: 6px;
}

.cookie-modal-content ul {
    padding-left: 18px;
    margin-bottom: 12px;
}

.cookie-modal-content li {
    font-size: 14px;
    margin-bottom: 4px;
}

.cookie-modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
}

.cookie-modal-close:hover {
    color: var(--primary);
}
.cookie-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999999; /* ⬅️ NAD WSZYSTKIM */
}
