﻿/* Inter (via Google Fonts in _Layout) */
:root {
    --brand: #0f172a; /* deep slate */
    --brand-2: #1e293b;
    --accent: #00B5AD; /* teal accent */
    --muted: #64748b;
    --border: #e7e7e7;
    --card: #fff;
}

html, body {
    height: 100%;
}

body {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    color: #0f172a;
    background: #fafbfc;
}

/* Header */
.navbar-brand {
    font-weight: 700;
    letter-spacing: .2px;
}

/* Hero */
.hero {
    background: radial-gradient(80% 120% at 10% 10%, #e2e8f0 0%, #ffffff 50%), linear-gradient(180deg, #ffffff 20%, #f8fafc 100%);
    border-bottom: 1px solid #e5e7eb;
}

    .hero .eyebrow {
        text-transform: uppercase;
        letter-spacing: .2em;
        font-weight: 600;
        color: var(--accent);
    }

    .hero h1 {
        font-weight: 800;
    }

    .hero p.lead {
        color: var(--muted);
        font-weight: 500;
    }

/* Cards */
.card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

    .card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

.card-title {
    font-weight: 700;
}

.card-pad {
    padding: 2rem;
}

/* Enhanced Upload Card */
.upload-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 2.5rem;
}

.upload-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.upload-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent) 0%, #009a92 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.section-title-main {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
    color: var(--brand);
}

/* Footer */
.footer {
    color: #475569;
    border-top: 1px solid #e5e7eb;
}

/* --- Layout --------------------------------------------------------------- */
.container {
    max-width: 1200px;
    margin-inline: auto;
    padding: 1.25rem;
}

.page-head {
    margin-bottom: 2.5rem;
}

    .page-head h1 {
        margin: 0 0 .5rem;
        font-size: clamp(1.75rem, 2vw + 1rem, 2.25rem);
        font-weight: 700;
    }

.page-subtitle {
    color: var(--muted);
    font-size: 1rem;
    margin: 0;
}

.flow-sm > * + * {
    margin-top: .75rem;
}

.mt-32 {
    margin-top: 2rem;
}

.grid-2, .grid-3 {
    display: grid;
    grid-template-columns: 1fr;
}

.gap {
    gap: 1.25rem;
}

@media (min-width: 880px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }

    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Form Fields ---------------------------------------------------------- */
.field {
    display: grid;
    gap: .5rem;
}

.label {
    font-size: .9rem;
    color: #374151;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.required-mark {
    color: #dc2626;
    font-weight: 600;
}

.muted {
    color: #9ca3af;
    font-weight: 400;
    font-size: .88rem;
}

.input {
    appearance: none;
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: .7rem .85rem;
    background: #fff;
    transition: all 0.2s ease;
    font-size: .95rem;
}

    .input:focus {
        outline: none;
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(0, 181, 173, 0.1);
    }

/* File Input Styling */
.file-input-wrapper {
    position: relative;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: .85rem 1rem;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: #374151;
}

    .file-input-label:hover {
        border-color: var(--accent);
        background: #f0fffe;
    }

    .file-input-label input[type="file"] {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

.actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: .75rem;
}

.hint {
    color: #6b7280;
    font-size: .85rem;
    margin: .25rem 0 0;
}

/* --- Buttons -------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    padding: .65rem 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: .9rem;
}

    .btn:hover {
        background: #f9fafb;
        border-color: #d1d5db;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }

.btn-primary,
button[type="submit"],
input[type="submit"] {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
    font-weight: 600;
}

    .btn-primary:hover,
    button[type="submit"]:hover,
    input[type="submit"]:hover {
        background: #000;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

.btn-brand {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

    .btn-brand:hover {
        background: #009a92;
        border-color: #009a92;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 181, 173, 0.3);
    }

.btn-success {
    background: #10b981;
    border-color: #10b981;
    color: white;
    font-weight: 600;
}

    .btn-success:hover {
        background: #059669;
        border-color: #059669;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }

.btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
    font-weight: 600;
}

    .btn-danger:hover {
        background: #dc2626;
        border-color: #dc2626;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    }

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
    font-weight: 500;
}

    .btn-secondary:hover {
        background: #e5e7eb;
        border-color: #9ca3af;
        transform: translateY(-1px);
    }

.btn-compact {
    padding: .45rem .75rem;
    font-size: .88rem;
}

.btn-sm {
    padding: .5rem .85rem;
    font-size: .88rem;
}

.inline {
    display: inline;
}

/* File Input Buttons */
input[type="file"] {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .55rem;
}

    input[type="file"]::file-selector-button,
    input[type="file"]::-webkit-file-upload-button {
        background: var(--brand);
        color: #fff;
        border: 1px solid var(--brand);
        padding: .45rem .8rem;
        border-radius: 8px;
        font-weight: 600;
        margin-right: .6rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }

        input[type="file"]::file-selector-button:hover,
        input[type="file"]::-webkit-file-upload-button:hover {
            background: #000;
            transform: translateY(-1px);
        }

/* --- Tables --------------------------------------------------------------- */
.table-wrap {
    overflow-x: auto;
}

.table-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}

    .table th, .table td {
        padding: 1rem 1.25rem;
        border-bottom: 1px solid #f3f4f6;
        vertical-align: middle;
    }

    .table thead {
        background: #f9fafb;
    }

        .table thead th {
            text-align: left;
            font-weight: 600;
            color: #6b7280;
            font-size: .85rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

    .table tbody tr:hover {
        background: #fafbfc;
    }

    .table tbody tr:last-child td {
        border-bottom: none;
    }

.table-modern thead th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
}

.table-modern td, .table-modern th {
    vertical-align: middle;
}

.links-table .col-file {
    max-width: 28ch;
}

.links-table .col-url {
    max-width: 46ch;
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--brand);
    margin: 0;
}

.files-count {
    font-size: .88rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: .4rem .9rem;
    border-radius: 20px;
    font-weight: 500;
}

/* --- Utility Classes ------------------------------------------------------ */
.text-right {
    text-align: right;
}

.nowrap {
    white-space: nowrap;
}

.empty {
    text-align: center;
    color: #9ca3af;
    padding: 3rem 1rem;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-text {
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: .5rem;
}

.empty-subtext {
    font-size: .9rem;
    color: #9ca3af;
}

.truncate {
    max-width: 46ch;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge {
    display: inline-block;
    padding: .25rem .65rem;
    border-radius: 6px;
    background: #dbeafe;
    color: #1e40af;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .01em;
}

/* File name with icon */
.file-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.file-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* Validation */
.text-danger {
    color: #dc2626;
    font-size: .88rem;
    margin-top: .25rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-danger {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-success {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .upload-card {
        padding: 1.5rem;
    }

    .card-pad {
        padding: 1.25rem;
    }

    .table th, .table td {
        padding: .75rem;
    }

    .btn-sm {
        padding: .4rem .65rem;
        font-size: .82rem;
    }
}
