/* Brain Harvester v3.0 - Document Combiner & AICP Compressor */
/* Path: brain-harvester-v3.css */
/* THEME: Blood Red & Black */

.project-container {
    padding-top: 70px;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===== BLOOD RED & BLACK THEME VARIABLES ===== */
:root {
    --blood-red: #8B0000;
    --dark-red: #660000;
    --bright-red: #FF0000;
    --crimson: #DC143C;
    --blood-accent: #FF4444;
    --blood-light: #FF6B6B;
    --black: #000000;
    --dark-gray: #1a1a1a;
    --medium-gray: #333333;
    --light-gray: #666666;
    --text-light: #e0e0e0;
    --text-dark: #000000;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
    --glow: 0 0 10px rgba(255, 0, 0, 0.3);
    --radius: 8px;
    --transition: all 0.3s ease;
}

[data-theme="light"] {
    --blood-red: #8B0000;
    --dark-red: #660000;
    --bright-red: #FF0000;
    --crimson: #DC143C;
    --blood-accent: #FF4444;
    --blood-light: #FF6B6B;
    --black: #ffffff;
    --dark-gray: #f0f0f0;
    --medium-gray: #e0e0e0;
    --light-gray: #cccccc;
    --text-light: #000000;
    --text-dark: #000000;
    --shadow: 0 4px 8px rgba(139, 0, 0, 0.2);
    --glow: 0 0 10px rgba(255, 0, 0, 0.2);
}

/* ===== APP CONTAINER ===== */
#app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: var(--text-light);
}

/* ===== HEADER ===== */
.app-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: var(--dark-gray);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 2px solid var(--blood-red);
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--blood-red), var(--crimson), var(--blood-red));
}

.app-header h1 {
    color: var(--blood-red);
    margin-bottom: 10px;
    font-size: 2.5em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.subtitle {
    color: var(--blood-accent);
    font-size: 1.2em;
    margin-bottom: 10px;
    font-weight: 500;
    letter-spacing: 1px;
}

.description {
    color: var(--text-light);
    font-size: 1em;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    opacity: 0.9;
}

/* ===== WORKFLOW STEPS ===== */
.workflow-steps {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    position: relative;
}

.workflow-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50px;
    right: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--blood-red), var(--black), var(--blood-red));
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    opacity: 0.5;
    transition: var(--transition);
}

.step.active {
    opacity: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--black);
    border: 2px solid var(--blood-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
    transition: var(--transition);
    color: var(--text-light);
    font-size: 1.1em;
}

.step.active .step-number {
    background: var(--blood-red);
    color: white;
    border-color: var(--bright-red);
    box-shadow: var(--glow);
    transform: scale(1.1);
}

.step-label {
    font-weight: 500;
    color: var(--light-gray);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.step.active .step-label {
    color: var(--blood-accent);
    font-weight: 600;
}

/* ===== SECTIONS ===== */
.section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== UPLOAD ZONE ===== */
.upload-zone {
    border: 3px dashed var(--blood-red);
    border-radius: var(--radius);
    padding: 60px 20px;
    text-align: center;
    background: var(--dark-gray);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 30px;
    position: relative;
    backdrop-filter: blur(10px);
}

.upload-zone:hover {
    border-color: var(--bright-red);
    background: rgba(26, 26, 26, 0.9);
    box-shadow: var(--glow);
    transform: translateY(-2px);
}

.upload-zone.drag-over {
    border-color: var(--bright-red);
    background: rgba(139, 0, 0, 0.1);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.5);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 0, 0.3); }
    50% { box-shadow: 0 0 30px rgba(255, 0, 0, 0.7); }
}

.upload-icon {
    font-size: 48px;
    color: var(--blood-red);
    margin-bottom: 20px;
    text-shadow: var(--glow);
    filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.5));
}

.upload-zone h3 {
    margin-bottom: 10px;
    color: var(--text-light);
    font-size: 1.4em;
}

.upload-zone p {
    color: var(--light-gray);
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 0.9em;
    color: var(--blood-accent);
    font-weight: 500;
    margin-top: 10px;
    display: inline-block;
    padding: 5px 15px;
    background: rgba(139, 0, 0, 0.2);
    border-radius: 20px;
}

#file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* ===== FILE LIST ===== */
.file-list {
    background: var(--dark-gray);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 30px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--blood-red);
}

.file-list::-webkit-scrollbar {
    width: 8px;
}

.file-list::-webkit-scrollbar-track {
    background: var(--black);
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb {
    background: var(--blood-red);
    border-radius: 4px;
}

.file-list::-webkit-scrollbar-thumb:hover {
    background: var(--bright-red);
}

.file-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--medium-gray);
    transition: var(--transition);
}

.file-item:hover {
    background: rgba(139, 0, 0, 0.1);
    border-left: 3px solid var(--blood-red);
    transform: translateX(5px);
}

.file-item:last-child {
    border-bottom: none;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: var(--black);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--blood-red);
    border: 1px solid var(--blood-red);
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.9em;
    color: var(--light-gray);
}

.file-remove {
    background: none;
    border: none;
    color: var(--blood-red);
    cursor: pointer;
    padding: 5px;
    font-size: 1.2em;
    transition: var(--transition);
    flex-shrink: 0;
}

.file-remove:hover {
    color: var(--bright-red);
    transform: scale(1.2);
}

/* ===== BUTTONS ===== */
.upload-controls,
.processing-controls,
.results-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blood-red), var(--crimson));
    color: white;
    border: 1px solid var(--bright-red);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--dark-red), var(--blood-red));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.4);
}

.btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-secondary {
    background: var(--black);
    color: var(--text-light);
    border: 1px solid var(--blood-red);
}

.btn-secondary:hover {
    background: var(--dark-gray);
    transform: translateY(-2px);
    border-color: var(--bright-red);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ===== PROCESSING SECTION ===== */
.processing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: var(--dark-gray);
    border-radius: var(--radius);
    border: 1px solid var(--blood-red);
}

.progress-info {
    text-align: right;
}

#progress-text {
    display: block;
    color: var(--text-light);
    margin-bottom: 5px;
    font-size: 0.9em;
}

#progress-percent {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--blood-red);
    text-shadow: var(--glow);
}

.progress-container {
    background: var(--black);
    border-radius: var(--radius);
    height: 10px;
    margin-bottom: 40px;
    overflow: hidden;
    border: 1px solid var(--blood-red);
}

.progress-bar {
    width: 100%;
    height: 100%;
    position: relative;
}

.progress-fill {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--blood-red), var(--crimson), var(--blood-accent));
    width: 0%;
    transition: width 0.5s ease;
    border-radius: var(--radius);
}

.pipeline-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.pipeline-step {
    background: var(--dark-gray);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.pipeline-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--blood-red);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.pipeline-step.active {
    background: rgba(139, 0, 0, 0.1);
    border-color: var(--blood-red);
}

.pipeline-step.active::before {
    transform: translateX(0);
}

.pipeline-step.completed {
    opacity: 0.9;
    border-color: var(--crimson);
}

.pipeline-step.completed .step-icon {
    background: var(--blood-red);
    color: white;
    box-shadow: var(--glow);
}

.step-icon {
    width: 50px;
    height: 50px;
    background: var(--black);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: var(--blood-red);
    border: 1px solid var(--blood-red);
    flex-shrink: 0;
    transition: var(--transition);
}

.step-content {
    flex: 1;
    min-width: 0;
}

.step-content h4 {
    margin-bottom: 5px;
    color: var(--text-light);
    font-size: 1.1em;
}

.step-status {
    font-size: 0.9em;
    color: var(--light-gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== RESULTS SECTION ===== */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--dark-gray);
    border-radius: var(--radius);
    border: 1px solid var(--blood-red);
    flex-wrap: wrap;
    gap: 20px;
}

.compression-badge {
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--blood-red), var(--crimson));
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1.1em;
    border: 1px solid var(--bright-red);
    box-shadow: var(--glow);
    white-space: nowrap;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--dark-gray);
    border-radius: var(--radius);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    border: 1px solid var(--medium-gray);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--blood-red), var(--crimson));
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border-color: var(--blood-red);
}

.stat-card:hover::before {
    transform: translateY(0);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: var(--black);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    color: var(--blood-red);
    border: 1px solid var(--blood-red);
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-content h4 {
    margin-bottom: 10px;
    color: var(--blood-accent);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.stat-value {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--text-light);
    line-height: 1.2;
}

.chart-container {
    background: var(--dark-gray);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 40px;
    border: 1px solid var(--blood-red);
    position: relative;
    height: 300px;
}

/* ===== AICP PREVIEW ===== */
.aicp-preview {
    background: var(--dark-gray);
    border-radius: var(--radius);
    margin-bottom: 40px;
    overflow: hidden;
    border: 1px solid var(--blood-red);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--black);
    border-bottom: 1px solid var(--blood-red);
    flex-wrap: wrap;
    gap: 15px;
}

.layer-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.layer-btn {
    padding: 8px 16px;
    background: var(--dark-gray);
    border: 1px solid var(--blood-red);
    border-radius: 4px;
    color: var(--light-gray);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9em;
    white-space: nowrap;
}

.layer-btn:hover {
    background: rgba(139, 0, 0, 0.2);
    color: var(--text-light);
}

.layer-btn.active {
    background: var(--blood-red);
    color: white;
    border-color: var(--bright-red);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.preview-content {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    background: #000000;
}

.preview-content::-webkit-scrollbar {
    width: 8px;
}

.preview-content::-webkit-scrollbar-track {
    background: #111;
}

.preview-content::-webkit-scrollbar-thumb {
    background: var(--blood-red);
    border-radius: 4px;
}

[data-theme="light"] .preview-content {
    background: #111111;
}

#aicp-preview-content {
    margin: 0;
    color: #FF4444;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.4;
    tab-size: 2;
}

[data-theme="light"] #aicp-preview-content {
    color: #FF0000;
}

/* ===== ICONS ===== */
.icon-brain::before { content: "🧠"; }
.icon-upload::before { content: "📤"; }
.icon-gear::before { content: "⚙️"; }
.icon-clean::before { content: "🧹"; }
.icon-deduplicate::before { content: "🔍"; }
.icon-compress::before { content: "🗜️"; }
.icon-aicp::before { content: "⚡"; }
.icon-chart::before { content: "📊"; }
.icon-file::before { content: "📄"; }
.icon-compressed::before { content: "📦"; }
.icon-savings::before { content: "💰"; }
.icon-time::before { content: "⏱️"; }
.icon-eye::before { content: "👁️"; }
.icon-download::before { content: "⬇️"; }
.icon-success::before { content: "✅"; }
.icon-error::before { content: "❌"; }
.icon-warning::before { content: "⚠️"; }
.icon-info::before { content: "ℹ️"; }

/* ===== NOTIFICATIONS ===== */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 15px 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    animation: slideIn 0.3s ease;
    background: var(--dark-gray);
    border: 1px solid var(--blood-red);
    color: var(--text-light);
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.notification-success {
    background: rgba(0, 100, 0, 0.9);
    border-color: #00FF00;
}

.notification-error {
    background: rgba(139, 0, 0, 0.9);
    border-color: var(--bright-red);
}

.notification-warning {
    background: rgba(139, 69, 19, 0.9);
    border-color: #FFA500;
}

.notification-info {
    background: rgba(0, 0, 139, 0.9);
    border-color: #4169E1;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2em;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

/* ===== MOBILE RESPONSIVENESS ===== */
@media (max-width: 768px) {
    .project-container {
        padding-top: 60px;
        padding-bottom: 20px;
    }

    #app-container {
        padding: 10px;
    }

    .app-header {
        padding: 20px 15px;
        margin-bottom: 30px;
    }

    .app-header h1 {
        font-size: 1.8em;
        flex-direction: column;
        gap: 10px;
    }

    .subtitle {
        font-size: 1em;
    }

    .description {
        font-size: 0.9em;
    }

    .workflow-steps {
        gap: 10px;
        margin-bottom: 30px;
    }

    .workflow-steps::before {
        left: 30px;
        right: 30px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.9em;
    }

    .step-label {
        font-size: 0.8em;
    }

    .upload-controls,
    .processing-controls,
    .results-controls {
        flex-direction: column;
        gap: 15px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        min-width: unset;
        padding: 12px 20px;
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .layer-selector {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 10px;
        justify-content: flex-start;
    }

    .pipeline-steps {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .chart-container {
        padding: 15px;
        height: 250px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }

    .stat-value {
        font-size: 1.5em;
    }

    .notification {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.5em;
    }

    .upload-zone {
        padding: 40px 15px;
    }

    .upload-icon {
        font-size: 36px;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }

    .file-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }

    .progress-info {
        text-align: center;
        width: 100%;
        margin-top: 10px;
    }

    .processing-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .project-container {
        padding-top: 0;
    }

    .upload-controls,
    .processing-controls,
    .results-controls,
    .layer-selector,
    .file-remove,
    .notification,
    .progress-container {
        display: none !important;
    }

    .section:not(.active) {
        display: none !important;
    }

    .btn-primary,
    .btn-secondary {
        border: 1px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideIn {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

@keyframes slideOut {
    from { 
        transform: translateX(0); 
        opacity: 1; 
    }
    to { 
        transform: translateX(100%); 
        opacity: 0; 
    }
}

@keyframes pulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4); 
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(255, 0, 0, 0); 
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(255, 0, 0, 0); 
    }
}

/* ===== LOADING STATES ===== */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}