/* ============================================
   90s RETRO RODLA FRONTEND STYLESHEET
   Single Color: Teal #008080
   No Gradients - Pure 90s Vibes
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #008080;      /* Teal */
    --bg-color: #000000;            /* Black */
    --text-color: #00FF00;          /* Lime green */
    --border-color: #008080;        /* Teal */
    --highlight-color: #00FF00;     /* Lime for highlights */
    --accent-color: #00FFFF;        /* Cyan accents */
    --error-color: #FF0000;         /* Red for errors */
    --font-family: "MS Sans Serif", "Arial", sans-serif;
}

/* ============================================
   BODY & GENERAL STYLES
   ============================================ */

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* CRT Scanlines Effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 999;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   HEADER
   ============================================ */

.header {
    text-align: center;
    border: 3px solid var(--primary-color);
    padding: 20px;
    margin-bottom: 30px;
    background-color: var(--bg-color);
}

.title {
    font-size: 48px;
    font-weight: bold;
    color: var(--accent-color);
    letter-spacing: 4px;
    text-shadow: 2px 2px 0 var(--primary-color);
    margin-bottom: 10px;
    font-family: "Courier New", monospace;
}

.subtitle {
    font-size: 16px;
    color: var(--text-color);
    letter-spacing: 2px;
    margin-bottom: 5px;
    font-family: "Courier New", monospace;
}

.version-text {
    font-size: 12px;
    color: var(--primary-color);
    letter-spacing: 1px;
    font-family: "Courier New", monospace;
}

/* ============================================
   SECTIONS
   ============================================ */

.section {
    border: 2px solid var(--primary-color);
    padding: 20px;
    margin-bottom: 20px;
    background-color: var(--bg-color);
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 15px;
    letter-spacing: 2px;
    font-family: "Courier New", monospace;
    text-transform: uppercase;
}

/* ============================================
   UPLOAD SECTION
   ============================================ */

.upload-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-box {
    border: 2px dashed var(--primary-color);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background-color: var(--bg-color);
    transition: all 0.3s ease;
}

.upload-box:hover {
    border-style: solid;
    color: var(--highlight-color);
}

.upload-box.dragover {
    border: 2px solid var(--highlight-color);
    background-color: var(--bg-color);
}

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

.upload-text {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.upload-subtext {
    font-size: 12px;
    color: var(--primary-color);
}

/* Preview */
.preview-container {
    border: 1px solid var(--primary-color);
    padding: 15px;
    margin-top: 15px;
    background-color: var(--bg-color);
}

.preview-label {
    font-size: 12px;
    color: var(--accent-color);
    margin-bottom: 10px;
    font-family: "Courier New", monospace;
}

.preview-image {
    max-width: 100%;
    height: auto;
    max-height: 300px;
    border: 1px solid var(--primary-color);
    display: block;
    margin: 10px 0;
}

.preview-info {
    font-size: 12px;
    color: var(--text-color);
    margin-top: 10px;
    font-family: "Courier New", monospace;
}

.preview-info p {
    margin: 5px 0;
}

/* ============================================
   OPTIONS SECTION
   ============================================ */

.options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.label {
    font-size: 12px;
    font-weight: bold;
    color: var(--accent-color);
    letter-spacing: 1px;
    font-family: "Courier New", monospace;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider {
    flex: 1;
    height: 20px;
    appearance: none;
    background-color: var(--bg-color);
    border: 1px solid var(--primary-color);
    cursor: pointer;
    accent-color: var(--primary-color);
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border: 1px solid var(--text-color);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    border: 1px solid var(--text-color);
    cursor: pointer;
}

.value-display {
    min-width: 40px;
    text-align: right;
    font-family: "Courier New", monospace;
    color: var(--highlight-color);
}

/* Button Groups */
.button-group {
    display: flex;
    gap: 10px;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    border: 2px solid var(--primary-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--font-family);
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    border-color: var(--highlight-color);
    color: var(--highlight-color);
}

.mode-btn.active {
    background-color: var(--primary-color);
    color: var(--bg-color);
    border-color: var(--accent-color);
}

/* ============================================
   PERTURBATION OPTIONS
   ============================================ */

.perturbation-options {
    border: 1px solid var(--primary-color);
    padding: 15px;
    margin-top: 15px;
    background-color: var(--bg-color);
}

.perturbation-title {
    font-size: 12px;
    color: var(--accent-color);
    margin-bottom: 10px;
    font-family: "Courier New", monospace;
    font-weight: bold;
}

.perturbation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-color);
}

.checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-label:hover {
    color: var(--highlight-color);
}

/* ============================================
   BUTTONS
   ============================================ */

.button-section {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn {
    padding: 12px 24px;
    border: 2px solid var(--primary-color);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    font-family: var(--font-family);
    letter-spacing: 1px;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.btn:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: var(--bg-color);
    border-color: var(--highlight-color);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--accent-color);
    color: var(--bg-color);
}

.btn-secondary {
    border-color: var(--primary-color);
}

/* ============================================
   STATUS SECTION
   ============================================ */

.status-section {
    display: flex;
    justify-content: center;
}

.status-box {
    width: 100%;
    max-width: 500px;
}

.status-text {
    text-align: center;
    margin-bottom: 15px;
    color: var(--highlight-color);
    font-family: "Courier New", monospace;
    font-size: 12px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0.5; }
}

.progress-bar {
    width: 100%;
    height: 20px;
    border: 1px solid var(--primary-color);
    background-color: var(--bg-color);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* ============================================
   RESULTS SECTION
   ============================================ */

.results-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.results-image-container {
    grid-column: 1;
}

.result-label {
    font-size: 11px;
    color: var(--accent-color);
    margin-bottom: 8px;
    font-family: "Courier New", monospace;
    font-weight: bold;
}

.result-image {
    max-width: 100%;
    height: auto;
    max-height: 500px;
    border: 2px solid var(--primary-color);
    display: block;
}

/* Stats Cards */
.results-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat-card {
    border: 2px solid var(--primary-color);
    padding: 15px;
    text-align: center;
    background-color: var(--bg-color);
}

.stat-title {
    font-size: 11px;
    color: var(--accent-color);
    margin-bottom: 8px;
    font-weight: bold;
    font-family: "Courier New", monospace;
}

.stat-value {
    font-size: 24px;
    color: var(--highlight-color);
    font-weight: bold;
    font-family: "Courier New", monospace;
}

/* Class Distribution */
.class-distribution {
    grid-column: 1 / -1;
}

.class-chart {
    border: 1px solid var(--primary-color);
    padding: 15px;
    background-color: var(--bg-color);
}

.chart-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
}

.chart-label {
    min-width: 120px;
    color: var(--text-color);
    font-family: "Courier New", monospace;
}

.chart-bar-container {
    flex: 1;
    height: 20px;
    background-color: var(--bg-color);
    border: 1px solid var(--primary-color);
    margin: 0 10px;
    position: relative;
}

.chart-bar {
    height: 100%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-count {
    color: var(--highlight-color);
    font-weight: bold;
    font-size: 11px;
    font-family: "Courier New", monospace;
}

/* Detections Table */
.detections-table-container {
    grid-column: 1 / -1;
    overflow-x: auto;
}

.detections-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--primary-color);
    font-size: 11px;
    font-family: "Courier New", monospace;
}

.detections-table thead {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

.detections-table th {
    padding: 8px;
    text-align: left;
    border: 1px solid var(--primary-color);
    font-weight: bold;
}

.detections-table td {
    padding: 8px;
    border: 1px solid var(--primary-color);
    color: var(--text-color);
}

.detections-table tbody tr:nth-child(even) {
    background-color: var(--bg-color);
}

.detections-table tbody tr:nth-child(odd) {
    background-color: var(--bg-color);
}

.detections-table tbody tr:hover {
    background-color: var(--bg-color);
    color: var(--highlight-color);
}

.no-data {
    text-align: center;
    color: var(--primary-color);
}

/* Metrics */
.metrics-container {
    grid-column: 1 / -1;
}

.metrics-box {
    border: 1px solid var(--primary-color);
    padding: 15px;
    background-color: var(--bg-color);
    font-family: "Courier New", monospace;
    font-size: 12px;
}

.metric-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--text-color);
}

.metric-line:last-child {
    margin-bottom: 0;
}

.metric-label {
    color: var(--accent-color);
    font-weight: bold;
}

.metric-value {
    color: var(--highlight-color);
}

/* Download Section */
.download-section {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* ============================================
   PERTURBATIONS PREVIEW SECTION
   ============================================ */

.perturbations-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.perturbation-preview-item {
    border: 1px solid var(--primary-color);
    padding: 15px;
    background-color: var(--bg-color);
}

.perturbation-preview-label {
    font-size: 11px;
    color: var(--accent-color);
    margin-bottom: 8px;
    font-family: "Courier New", monospace;
    font-weight: bold;
    text-transform: uppercase;
}

.perturbation-preview-image {
    max-width: 100%;
    height: auto;
    max-height: 250px;
    border: 1px solid var(--primary-color);
    display: block;
    margin-bottom: 10px;
}

.perturbation-button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* ============================================
   ERROR SECTION
   ============================================ */

.error-section {
    display: flex;
    justify-content: center;
}

.error-box {
    border: 2px solid var(--error-color);
    padding: 20px;
    background-color: var(--bg-color);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.error-title {
    color: var(--error-color);
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    font-family: "Courier New", monospace;
}

.error-message {
    color: var(--text-color);
    font-size: 12px;
    margin-bottom: 15px;
    font-family: "Courier New", monospace;
}

/* ============================================
   INFO SECTION
   ============================================ */

.info-box {
    border: 1px solid var(--primary-color);
    padding: 15px;
    background-color: var(--bg-color);
    font-family: "Courier New", monospace;
    font-size: 12px;
}

.info-box p {
    color: var(--text-color);
    margin-bottom: 8px;
}

.info-box .label {
    color: var(--accent-color);
    font-weight: bold;
    margin-right: 10px;
}

.status-online {
    color: var(--highlight-color);
    font-weight: bold;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    text-align: center;
    border-top: 2px solid var(--primary-color);
    padding-top: 20px;
    margin-top: 40px;
    color: var(--primary-color);
    font-size: 12px;
    font-family: "Courier New", monospace;
}

.footer p {
    margin: 5px 0;
}

.footer-ascii {
    font-size: 11px;
    letter-spacing: 1px;
    margin-top: 10px;
}

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

@media (max-width: 768px) {
    .title {
        font-size: 32px;
    }

    .subtitle {
        font-size: 14px;
    }

    .button-group {
        flex-direction: column;
    }

    .results-stats {
        grid-template-columns: 1fr;
    }

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

    .button-section {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .detections-table {
        font-size: 10px;
    }

    .detections-table th,
    .detections-table td {
        padding: 6px 4px;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .scanlines,
    .button-section,
    .status-section,
    .upload-section,
    .options-section {
        display: none;
    }

    .container {
        padding: 0;
    }

    .section {
        page-break-inside: avoid;
    }
}
