/* ============================================================
   Floorplan Enrichment MVP — UI Styles (Task-7 Figma Redesign)
   ============================================================ */

:root {
    --bg: #F6F7FC;
    --card: #FFFFFF;
    --border: #DFDEE7;
    --text: #454260;
    --text-label: #9896A6;
    --accent: #4B4EFB;
    --accent-hover: #3A3DE0;
    --accent-light: #8B8DFC;
    --btn-green: #20C997;
    --btn-green-hover: #5DDEB5;
    --error-bg: #FFF0F0;
    --error-border: #FFCFCF;
    --error-text: #9E1E3A;
    --shadow: 0 6px 16px rgba(227, 227, 249, 1);
}

/* --- Reset & body --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
/* --- Container --- */
.container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* --- Card --- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 32px 40px;
    margin: 24px 0;
    box-shadow: var(--shadow);
    width: 100%;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 14px 28px;
    min-width: 140px;
    font-size: 18px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    text-decoration: none;
    background: var(--accent);
    color: #fff;
    transition: background 0.15s;
    white-space: nowrap;
}
.btn:hover { background: var(--accent-light); }

.btn-green {
    background: var(--btn-green);
    color: #fff;
}
.btn-green:hover { background: var(--btn-green-hover); }

/* --- Header --- */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    height: 72px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}
.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}
.brand-logo {
    height: 48px;
    width: auto;
}
.topbar nav { display: flex; gap: 10px; flex-shrink: 0; }
.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 28px;
    height: 46px;
    border-radius: 100px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    background: var(--bg);
    color: var(--accent);
    border: 1px solid transparent;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-btn:hover {
    background: var(--bg);
    color: #4B4EFD;
    border-color: #4B4EFD;
}
.nav-btn--active {
    background: var(--accent);
    color: #fff;
}
.nav-btn--active:hover {
    background: #667AFF;
    color: #fff;
    border-color: transparent;
}

/* --- Footer --- */
.footer {
    padding: 24px 48px;
    font-size: 14px;
}

/* --- KV table (label + value) --- */
.kv {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 14px 20px;
}
.kv dt {
    color: var(--text-label);
    font-size: 15px;
    font-weight: 400;
}
.kv dd {
    color: var(--text);
    font-size: 15px;
    font-weight: 400;
}

/* --- Error block --- */
.error-block {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 16px;
    padding: 20px 24px;
    margin: 24px 0;
    color: var(--error-text);
    font-size: 15px;
    font-weight: 500;
}

/* --- Info block --- */
.info-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px 24px;
    margin-top: 24px;
    font-size: 15px;
    line-height: 1.6;
}

/* --- Utility classes --- */
.muted { color: var(--text-label); font-size: 14px; }
.error { color: var(--error-text); }
.accent-text { color: var(--accent); }

/* --- Upload page --- */
.upload-page {
    flex: 1;
    display: flex;
    align-items: center;
}

.drop-zone {
    position: relative;
    border: none;
    border-radius: 16px;
    padding: 48px;
    min-height: 120px;
    background: #FFFFFF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s;
}
.drop-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    border: 4px dashed #BEBFFF;
    pointer-events: none;
    transition: border-color 0.15s;
}
.drop-zone:hover {
    background-color: #F3F3FF;
}
.drop-zone:hover::before {
    border-color: #7F80FF;
}
.drop-zone--active {
    background-color: #F3F3FF;
}
.drop-zone--active::before {
    border-color: #7F80FF;
}

.drop-label {
    color: var(--text);
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    display: block;
}

.upload-submit {
    width: min(100%, 300px);
    margin: 24px auto 0;
    display: block;
}

/* --- Table --- */
.table-wrapper { overflow-x: hidden; margin: 0 -8px; padding: 0 8px; }
.table {
    width: 100%;
    border-collapse: collapse;
    
}
.table th {
    color: var(--accent);
    font-weight: 600;
    font-size: 15px;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table td {
    padding: 14px 16px;
    font-size: 15px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
.table tr:last-child td { border-bottom: none; }
.filename-cell {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* --- Badges --- */
.badge {
    display: inline-block;
    min-width: 140px;
    text-align: center;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 14px;
    border: 1.5px solid;
    white-space: nowrap;
    color: var(--text);
}
.badge-pending    { background: #FFF8E0; border-color: #FAB005; }
.badge-processing { background: #E8F4FF; border-color: #3DB0E8; }
.badge-completed  { background: #E8FAF2; border-color: #20C997; }
.badge-failed     { background: #FFF0F0; border-color: #FF8080; }

/* --- Btn Open (table) --- */
.btn-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--accent);
    border-radius: 100px;
    padding: 6px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
}
.btn-open:hover {
    background: var(--accent);
    color: #fff;
}
.btn-open--disabled {
    border-color: var(--border);
    color: #C4C2E0;
    background: var(--bg);
    pointer-events: none;
    cursor: default;
}

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 24px 0;
    flex-wrap: wrap;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    background: transparent;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.page-btn:hover { background: var(--bg); }
.page-btn--active {
    background: var(--accent);
    color: #fff;
}

/* --- Job detail --- */
.job-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}
.job-title {
    font-size: 32px;
    font-weight: 600;
    color: var(--text);
}
.job-back {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
}

.btn-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}
.btn-row .btn { flex: 0 0 auto; }

/* --- Artifacts section --- */
.artifacts-section { margin-top: 16px; }
.artifacts-section h2 { font-size: 24px; font-weight: 700; margin-bottom: 12px; }
.artifacts-list { list-style: disc; padding-left: 24px; }
.artifacts-list li { margin-bottom: 8px; font-size: 15px; }
.artifacts-list a { color: var(--accent); text-decoration: none; }
.artifacts-list a:hover { text-decoration: underline; }

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet / small laptop */
@media (max-width: 768px) {
    .container { padding: 24px 16px; }

    .card { padding: 24px 20px; border-radius: 20px; }

    .kv { grid-template-columns: 1fr; gap: 4px 0; }
    .kv dt { font-size: 13px; margin-top: 10px; }
    .kv dt:first-child { margin-top: 0; }
    .kv dd { font-size: 15px; }

    .topbar { padding: 0 16px; }
    .nav-btn { padding: 8px 16px; font-size: 15px; height: 40px; }
    .brand-logo { height: 36px; }

    .btn { padding: 12px 20px; font-size: 16px; }
    .btn-row { gap: 12px; }
    .btn-row .btn { flex: 1 1 auto; min-width: 0; text-align: center; }
}

/* Phone */
@media (max-width: 480px) {
    .container { padding: 16px 12px; }

    .card { padding: 20px 16px; border-radius: 16px; }

    .topbar { height: 60px; }
    .brand-logo { height: 32px; }

    .table th, .table td { padding: 10px 10px; font-size: 13px; }
    .badge { font-size: 11px; padding: 3px 10px; }
    .btn-open { padding: 5px 14px; font-size: 13px; }

    .pagination { gap: 4px; }
    .page-btn { min-width: 32px; height: 32px; font-size: 13px; padding: 0 8px; }
}
