/* ═══════════════════════════════════════════
   Numetricon - Global Styles
   ═══════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica Neue, Arial, sans-serif;
}

body {
    background-color: #f5f5f5;
    min-height: 100vh;
}

.hidden { display: none !important; }

/* ── Main Content Area ── */
.main-content {
    padding: 0;
    max-width: 100%;
}

@media (max-width: 900px) {
    .ad-banner-side { display: none !important; }
}

/* ── Navigation Bar ── */
.navbar {
    background: white;
    padding: 20px 190px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .navbar { padding: 20px; }
}

.nav-logo {
    background: white;
    color: #333;
    border: none;
    font-size: 16px;
    font-weight: 700;
    padding: 0;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.nav-logo:hover { opacity: 0.7; }

/* ── View Containers ── */
.view {
    padding: 20px 190px;
}

@media (max-width: 900px) {
    .view { padding: 20px; }
}

/* ── Landing Page ── */
.landing-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 20px 0;
    min-height: 80vh;
    align-items: center;
}

@media (max-width: 768px) {
    .landing-container { grid-template-columns: 1fr; }
}

.landing-left { padding: 40px 20px; }

.landing-left h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 5px;
}

.landing-left .subtitle {
    font-size: 20px;
    color: #666;
    margin-bottom: 10px;
}

.landing-left .tagline {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.landing-left .description {
    font-size: 20px;
    color: #555;
    margin-bottom: 8px;
}

.landing-left .closing {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
}

.landing-right img {
    width: 100%;
    border-radius: 8px;
}

.landing-right .contact-email {
    text-align: center;
    padding: 10px;
}

.landing-right .contact-email a {
    color: #666;
    font-size: 14px;
    text-decoration: none;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    width: 100%;
}

.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-black { background-color: #000; color: #fff; font-size: 18px; padding: 14px; }
.btn-primary { background-color: #3463C8; color: #fff; }
.btn-dark { background-color: #224388; color: #fff; }
.btn-secondary { background-color: #e0e0e0; color: #333; }
.btn-danger { background-color: #dc3545; color: #fff; }

/* ── Module Selection Cards ── */
.section-title {
    font-size: 28px;
    font-weight: 600;
    color: #000;
    text-align: center;
    margin: 40px 0 30px 0;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 0;
}

@media (max-width: 768px) {
    .modules-grid { grid-template-columns: 1fr; }
}

.module-card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s;
    cursor: pointer;
    min-height: 170px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: none;
    width: 100%;
}

.module-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.module-card .icon { font-size: 48px; margin-bottom: 15px; }
.module-card .title { font-size: 20px; font-weight: 600; color: #000; }

/* ── Configuration Page ── */
.config-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.config-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.config-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.config-row select, .config-row input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.config-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.separator {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

/* ── Wizard (Input Form) ── */
.wizard-container { padding: 0; }

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #3463C8;
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.wizard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .wizard-content { grid-template-columns: 1fr; }
}

.wizard-image img { width: 100%; border-radius: 8px; }

.wizard-fields h3 { margin-bottom: 15px; color: #333; }

.field-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.field-row label { font-weight: 600; font-size: 14px; }

.field-row input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.wizard-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* ── CSV Mode ── */
.csv-container { padding: 0; }

.info-banner {
    background: #e8f4fd;
    border-left: 4px solid #3463C8;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    color: #333;
}

.warning-banner {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    color: #333;
}

.success-banner {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    color: #333;
}

.error-banner {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    color: #333;
}

.file-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 15px;
}

.file-upload-area:hover { border-color: #3463C8; background: #f8f9ff; }

.csv-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 20px 0;
}

/* ── Results Table ── */
.results-table-container { overflow-x: auto; margin: 20px 0; }

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.results-table th {
    background: #333;
    color: white;
    padding: 10px 8px;
    text-align: left;
    position: sticky;
    top: 0;
}

.results-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.results-table tr:hover { background: #f5f5f5; }
.row-safe td { color: blue; }
.row-unsafe td { color: red; }

/* ── Summary Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-card .label { font-size: 14px; color: #666; margin-bottom: 5px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #333; }

/* ── Result Card (Single Prediction) ── */
.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    color: white;
    margin: 40px auto;
    max-width: 500px;
}

.result-card .result-label { font-size: 16px; opacity: 0.9; }
.result-card .result-value { font-size: 40px; font-weight: 700; margin: 15px 0; }

/* ── Toast Notification ── */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 20px 40px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    z-index: 10000;
    animation: toastFadeInOut 3s ease;
}

@keyframes toastFadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    85% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* ── Expander ── */
.expander-header {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.expander-header:hover { background: #f9f9f9; }
.expander-content { display: none; padding: 10px 0; }
.expander-content.open { display: block; }
.expander-content img { width: 100%; margin-bottom: 10px; border-radius: 8px; }

/* ── Side Ad Banners ── */
.ad-banner-side {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 150px;
    height: 600px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: pointer;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    color: #000;
    font-size: 24px;
    font-weight: 700;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ad-left {
    left: 10px;
}

.ad-right {
    right: 10px;
}

/* ── Video Popup ── */
.video-popup-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
}

.video-popup-content {
    position: relative;
    width: 80%;
    max-width: 900px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.video-popup-content video {
    width: 100%;
    display: block;
}

.video-popup-close {
    position: absolute;
    top: 10px; right: 14px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    font-size: 28px;
    width: 40px; height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1;
    line-height: 1;
}

.video-popup-close:hover { background: rgba(0,0,0,0.9); }

/* ── Tutorial Button ── */
.btn-tutorial {
    display: block;
    margin: 30px auto 0;
    max-width: 500px;
    background: #fff;
    color: #3463C8;
    border: 2px solid #3463C8;
    font-weight: 600;
    font-size: 16px;
}

.btn-tutorial:hover {
    background: #3463C8;
    color: #fff;
}

/* ── Footer ── */
.app-footer {
    text-align: center;
    color: #666;
    padding: 20px;
    margin-top: 40px;
}

.app-footer a { color: #666; text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }

/* ── Spinner ── */
.spinner-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.spinner {
    width: 40px; height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #3463C8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
