/* Benford Holmes - Professional Forensic Analysis Tool */
/* Modern, Clean, iPhone-style Design */

:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #0f3460;
    --gold: #e94560;
    --success: #00d9ff;
    --warning: #ff6b6b;
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --bg: #0f0f1e;
    --panel-bg: #16213e;
    --border-radius: 16px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg) 0%, var(--primary) 100%);
    color: var(--text);
    min-height: 100vh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 40px 20px;
    background: var(--secondary);
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.logo {
    font-size: 56px;
    margin-bottom: 15px;
    animation: fadeIn 0.5s ease;
}

h1 {
    font-size: 36px;
    color: var(--gold);
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}

/* Panel System */
.panel {
    background: var(--panel-bg);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
    animation: slideUp 0.4s ease;
}

.panel-header {
    padding: 20px 24px;
    background: var(--accent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(233, 69, 96, 0.3);
}

.panel-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold);
    margin: 0;
}

.panel-body {
    padding: 28px 24px;
}

/* Upload Box */
.upload-box {
    border: 3px dashed var(--accent);
    border-radius: var(--border-radius);
    padding: 50px 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(15, 52, 96, 0.2);
}

.upload-box:hover {
    border-color: var(--gold);
    background: rgba(233, 69, 96, 0.1);
    transform: translateY(-2px);
}

.upload-box.dragover {
    border-color: var(--success);
    background: rgba(0, 217, 255, 0.15);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 56px;
    margin-bottom: 20px;
}

.upload-box h3 {
    font-size: 22px;
    margin-bottom: 12px;
    color: var(--text);
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 15px;
}

.file-types {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 20px;
}

/* Form Controls */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.optional {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: var(--accent);
    color: var(--text);
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 4px rgba(233, 69, 96, 0.1);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23e94560' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.4;
}

.range-filter {
    padding: 20px;
    background: rgba(233, 69, 96, 0.05);
    border-radius: 12px;
    border: 2px solid var(--gold);
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gold);
    color: white;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

.btn-primary:hover {
    background: #d13850;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 15px rgba(15, 52, 96, 0.3);
}

.btn-secondary:hover {
    background: #0d2a4f;
}

.btn-secondary {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.3);
}

.btn-secondary:hover {
    background: #00b8d4;
}

.btn-block {
    width: 100%;
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 12px;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: color 0.3s ease;
}

.btn-text:hover {
    color: var(--gold);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.alert-warning {
    background: rgba(255, 165, 0, 0.1);
    border: 2px solid rgba(255, 165, 0, 0.3);
    color: var(--text);
}

.alert ul {
    margin: 10px 0 0 20px;
    color: var(--text-secondary);
}

.alert li {
    margin: 4px 0;
    font-size: 14px;
}

/* Verdict */
.verdict {
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 28px;
    animation: fadeIn 0.5s ease;
}

.verdict.normal {
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.2), rgba(0, 217, 255, 0.05));
    border: 2px solid var(--success);
    color: var(--success);
}

.verdict.suspicious {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 107, 107, 0.05));
    border: 2px solid var(--warning);
    color: var(--warning);
}

/* Risk Meter */
.risk-meter-container {
    margin: 28px 0;
}

.risk-meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.risk-meter-label {
    font-weight: 600;
    font-size: 16px;
}

.risk-percentage {
    font-size: 28px;
    font-weight: 800;
    color: var(--gold);
}

.risk-meter-bar {
    width: 100%;
    height: 40px;
    background: var(--accent);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.risk-meter-fill {
    height: 100%;
    width: 0%;
    transition: width 1s ease, background 0.5s ease;
    border-radius: 20px;
}

.risk-meter-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 15px;
    font-weight: 800;
    z-index: 10;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 10px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.8);
    color: #ffffff;
    letter-spacing: 0.5px;
}

.risk-meter-legend {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Stats Section */
.stats-section {
    margin-top: 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--accent);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Audit Trail */
.audit-trail {
    padding: 16px 20px;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.8;
    margin-top: 16px;
}

.audit-trail strong {
    color: var(--success);
}

/* Anomaly Panel */
.anomaly-panel {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(233, 69, 96, 0.05));
    border: 2px solid var(--warning);
}

.anomaly-intro {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Anomaly Cards */
.anomaly-card {
    background: var(--accent);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    border-left: 5px solid;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.anomaly-card:hover {
    transform: translateX(4px);
}

.anomaly-card.critical {
    border-left-color: #ff3838;
    background: linear-gradient(135deg, rgba(255, 56, 56, 0.2), rgba(255, 107, 107, 0.05));
}

.anomaly-card.high {
    border-left-color: #ffa500;
    background: linear-gradient(135deg, rgba(255, 165, 0, 0.2), rgba(255, 165, 0, 0.05));
}

.anomaly-card.moderate {
    border-left-color: #ffd700;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
}

.anomaly-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.anomaly-digit {
    font-size: 48px;
    font-weight: 900;
    color: var(--gold);
    line-height: 1;
}

.anomaly-rank {
    background: var(--gold);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
}

.anomaly-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.anomaly-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.anomaly-stat-value {
    font-size: 18px;
    font-weight: 700;
}

.impact-indicator {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
    background: rgba(255, 107, 107, 0.2);
    color: var(--warning);
}

/* Info Box */
.info-box {
    padding: 16px 20px;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    margin-top: 20px;
    border-left: 3px solid var(--warning);
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 350px;
    margin: 20px 0;
}

/* Table */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px;
    text-align: center;
    border-bottom: 1px solid var(--accent);
}

th {
    background: var(--accent);
    color: var(--gold);
    font-weight: 600;
    font-size: 14px;
}

td {
    font-size: 15px;
}

tr:hover {
    background: rgba(233, 69, 96, 0.05);
}

.deviation {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.deviation.high {
    background: rgba(255, 107, 107, 0.2);
    color: var(--warning);
}

.deviation.normal {
    background: rgba(0, 217, 255, 0.2);
    color: var(--success);
}

/* Methodology Content */
.methodology-content h4 {
    color: var(--gold);
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 16px;
}

.methodology-content p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.7;
}

.methodology-content ul {
    margin: 12px 0 20px 20px;
    color: var(--text-secondary);
}

.methodology-content li {
    margin: 8px 0;
    line-height: 1.6;
}

/* Action Buttons */
.action-buttons {
    margin-top: 24px;
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 28px;
    }

    .logo {
        font-size: 42px;
    }

    .panel-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .panel-body {
        padding: 20px 16px;
    }

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

    .chart-container {
        height: 280px;
    }

    .anomaly-digit {
        font-size: 36px;
    }

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

    table {
        font-size: 13px;
    }

    th, td {
        padding: 10px 8px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .panel {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .btn, .action-buttons {
        display: none;
    }
}
