/* ===================================================================
   CySEC License Checker — Warm Mediterranean Light
   =================================================================== */

:root {
    --bg: #f8f4ee;
    --bg-warm: #f3ede5;
    --surface: #ffffff;
    --border: #e6dfd5;
    --border-light: #eee8df;
    --text: #3d3832;
    --text-mid: #6e655b;
    --text-soft: #a29888;
    --terracotta: #d4764e;
    --terracotta-light: #f5ded2;
    --terracotta-hover: #c46840;
    --teal: #3a9aaa;
    --teal-light: #daf0f4;
    --green: #4caf7c;
    --green-bg: #e4f5ec;
    --amber: #d9952a;
    --amber-bg: #fdf3dd;
    --red: #c94a4a;
    --red-bg: #fce8e8;
    --font-display: 'Bricolage Grotesque', Georgia, serif;
    --font-body: 'Outfit', -apple-system, sans-serif;
    --font-mono: 'Fira Code', 'Menlo', monospace;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(60, 50, 40, 0.06);
    --shadow: 0 2px 12px rgba(60, 50, 40, 0.07), 0 1px 3px rgba(60, 50, 40, 0.05);
    --shadow-lg: 0 8px 30px rgba(60, 50, 40, 0.1), 0 2px 8px rgba(60, 50, 40, 0.04);
}

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

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Soft warm radial glow at top */
body::before {
    content: '';
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 600px;
    background: radial-gradient(ellipse, rgba(212, 118, 78, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.page {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === HEADER === */

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--terracotta-light);
    color: var(--terracotta);
    border-radius: var(--radius);
    flex-shrink: 0;
}

.brand h1 {
    font-family: var(--font-display);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text);
    letter-spacing: -0.01em;
}

.tagline {
    font-size: 0.8rem;
    color: var(--text-soft);
    font-weight: 400;
    margin-top: 1px;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    color: var(--text-soft);
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border);
    transition: background 0.3s, box-shadow 0.3s;
}

.status-pill.online .status-dot {
    background: var(--green);
    box-shadow: 0 0 6px rgba(76, 175, 124, 0.5);
}

.status-pill.online .status-label {
    color: var(--text-mid);
}

.status-pill.mock .status-dot {
    background: var(--amber);
    box-shadow: 0 0 6px rgba(217, 149, 42, 0.4);
}

/* === CARDS === */

.card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* === INPUT CARD === */

.input-card {
    padding: 24px;
}

.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.card-top h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}

.url-counter {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-soft);
    background: var(--bg-warm);
    padding: 2px 10px;
    border-radius: 100px;
    min-width: 20px;
    text-align: center;
    transition: color 0.2s, background 0.2s;
}

.url-counter.has-urls {
    color: var(--terracotta);
    background: var(--terracotta-light);
}

textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.7;
    resize: vertical;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea::placeholder {
    color: var(--text-soft);
    opacity: 0.7;
}

textarea:focus {
    outline: none;
    border-color: var(--terracotta);
    box-shadow: 0 0 0 3px rgba(212, 118, 78, 0.1);
    background: var(--surface);
}

/* Prompt section */

.prompt-section {
    margin-top: 12px;
    margin-bottom: 4px;
}

.prompt-section summary {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-soft);
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
    list-style: none;
}

.prompt-section summary::-webkit-details-marker { display: none; }

.prompt-section summary::before {
    content: '+';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--bg-warm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-soft);
    transition: transform 0.2s, background 0.2s, color 0.2s;
}

.prompt-section[open] summary::before {
    transform: rotate(45deg);
    background: var(--terracotta-light);
    color: var(--terracotta);
}

.prompt-section summary:hover {
    color: var(--terracotta);
}

.prompt-section textarea {
    margin-top: 10px;
    font-family: var(--font-body);
    font-size: 0.82rem;
}

/* Buttons */

.actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 16px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    background: var(--terracotta);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(212, 118, 78, 0.25);
}

.btn-primary:hover {
    background: var(--terracotta-hover);
    box-shadow: 0 4px 16px rgba(212, 118, 78, 0.3);
    transform: translateY(-1px);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary svg {
    transition: transform 0.15s;
}

.btn-primary:hover svg {
    transform: translateX(2px);
}

.btn-soft {
    padding: 10px 16px;
    background: var(--bg-warm);
    color: var(--text-mid);
    font-family: var(--font-body);
    font-size: 0.82rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-soft:hover {
    background: var(--border);
    color: var(--text);
}

/* === LOADING === */

.loading {
    text-align: center;
    padding: 40px 0;
}

.loading-dots {
    display: inline-flex;
    gap: 6px;
    margin-bottom: 14px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--terracotta);
    animation: bounce 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

.loading p {
    font-size: 0.85rem;
    color: var(--text-soft);
}

/* === RESULTS === */

.results {
    margin-top: 28px;
    animation: fade-up 0.35s ease-out;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.results-top h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
}

.results-counts {
    display: flex;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-mid);
}

.results-counts .count-ok {
    color: var(--green);
    font-weight: 600;
}

.results-counts .count-fail {
    color: var(--red);
    font-weight: 600;
}

/* Table */

.table-card {
    overflow: hidden;
}

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

thead {
    background: var(--bg);
}

th {
    padding: 11px 16px;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

th.sortable:hover {
    color: var(--terracotta);
}

.sort-arrow {
    margin-left: 3px;
    opacity: 0.35;
    font-size: 0.7rem;
}

th.sortable:hover .sort-arrow,
th.sortable.active .sort-arrow {
    opacity: 1;
    color: var(--terracotta);
}

td {
    padding: 13px 16px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

tbody tr {
    transition: background 0.12s;
}

tbody tr:hover {
    background: rgba(243, 237, 229, 0.5);
}

tbody tr:last-child td {
    border-bottom: none;
}

.company-name {
    font-weight: 500;
    color: var(--text);
}

.license-num {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-mid);
}

.details-text {
    font-size: 0.8rem;
    color: var(--text-soft);
    line-height: 1.5;
}

/* Status badges */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge-active {
    background: var(--green-bg);
    color: var(--green);
}

.badge-active::before { background: var(--green); }

.badge-warning {
    background: var(--amber-bg);
    color: var(--amber);
}

.badge-warning::before { background: var(--amber); }

.badge-danger {
    background: var(--red-bg);
    color: var(--red);
}

.badge-danger::before { background: var(--red); }

/* Source links */

.source-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--teal);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    transition: color 0.15s;
}

.source-link:hover {
    color: var(--terracotta);
}

/* Errors */

.errors {
    margin-top: 16px;
    background: var(--red-bg);
    border: 1px solid rgba(201, 74, 74, 0.15);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.errors-title {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 12px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--red);
    border-bottom: 1px solid rgba(201, 74, 74, 0.1);
}

.errors ul {
    list-style: none;
    padding: 4px 0;
}

.errors li {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(201, 74, 74, 0.06);
}

.errors li:last-child { border-bottom: none; }

.error-url {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--red);
    word-break: break-all;
}

.error-msg {
    font-size: 0.74rem;
    color: var(--text-soft);
    margin-top: 2px;
}

/* === FOOTER === */

footer {
    margin-top: auto;
    padding: 24px 0;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-soft);
}

/* === UTILITY === */

.hidden { display: none !important; }

/* Placeholder dash for empty cells */
.empty-cell {
    color: var(--border);
}

/* === RESPONSIVE === */

@media (max-width: 600px) {
    html { font-size: 14px; }
    .page { padding: 0 14px; }

    header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .status-pill {
        order: -1;
        width: 100%;
        justify-content: center;
    }

    .brand h1 { font-size: 1.3rem; }
    .input-card { padding: 18px; }

    .actions {
        flex-wrap: wrap;
    }

    .btn-primary { width: 100%; justify-content: center; }

    .results-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 560px; }
    th, td { padding: 10px 12px; }
}
