
/*   DebtData Global Stylesheet

/* ---------- Reset ---------- */

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

html{
    scroll-behavior:smooth;
}

body{
    background:#0b1220;
    color:#e5e7eb;
    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    min-height:100vh;
    line-height:1.5;
}

img{
    display:block;
    max-width:100%;
}

button,
input,
select{
    font:inherit;
}

button{
    cursor:pointer;
}

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

a{
    color:inherit;
    text-decoration:none;
}

ul,
ol{
    list-style:none;
}

/* ---------- Theme ---------- */

:root{

    --bg:#0b1220;
    --panel:#111827;
    --panel-light:#1f2937;

    --border:#273244;

    --text:#f8fafc;
    --muted:#94a3b8;

    --green:#22c55e;
    --red:#ef4444;
    --yellow:#f59e0b;
    --blue:#3b82f6;

    --radius:10px;

    --shadow:
        0 10px 25px rgba(0,0,0,.25);

    --transition:.18s ease;

}

/* ---------- Layout ---------- */

.site-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    padding:24px 48px;

    background:#111827;

    border-bottom:1px solid var(--border);

    position:sticky;

    top:0;

    z-index:100;

}

.header-left{

    display:flex;

    flex-direction:column;

    gap:4px;

}

.logo{

    font-size:2rem;

    font-weight:700;

    letter-spacing:-1px;

}

.logo span{

    color:var(--green);

}

.tagline{

    color:var(--muted);

    font-size:.95rem;

}

.header-right{

    display:flex;

    align-items:center;

    gap:18px;

}

.dashboard{

    max-width:1500px;

    margin:auto;

    padding:40px;

}

/* ---------- Status ---------- */

.status{

    display:flex;

    align-items:center;

    gap:10px;

    color:var(--muted);

    font-size:.9rem;

}

#status-dot{

    width:10px;

    height:10px;

    border-radius:50%;

    background:var(--yellow);

    animation:pulse 1.5s infinite;

}

@keyframes pulse{

    0%{
        opacity:1;
    }

    50%{
        opacity:.35;
    }

    100%{
        opacity:1;
    }

}

/* ---------- Button ---------- */

#refresh-button{

    background:var(--blue);

    color:white;

    border:none;

    padding:10px 18px;

    border-radius:8px;

    transition:var(--transition);

}

#refresh-button:hover{

    background:#2563eb;

}

/* ---------- Metrics ---------- */

.metrics{

    display:grid;

    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));

    gap:20px;

    margin-bottom:40px;

}

.metric{

    background:var(--panel);

    border:1px solid var(--border);

    border-radius:var(--radius);

    padding:22px;

    box-shadow:var(--shadow);

}

.metric h2{

    color:var(--muted);

    font-size:.82rem;

    text-transform:uppercase;

    letter-spacing:.08em;

    margin-bottom:10px;

}

.metric p{

    font-size:1.7rem;

    font-weight:700;

    overflow:hidden;

    text-overflow:ellipsis;

}

/* ---------- Toolbar ---------- */

.toolbar{

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:20px;

    margin-bottom:30px;

    flex-wrap:wrap;

}

.toolbar-search{

    flex:1;

    min-width:280px;

}

.toolbar-search input{

    width:100%;

    background:var(--panel);

    color:var(--text);

    border:1px solid var(--border);

    padding:14px 18px;

    border-radius:8px;

}

.toolbar-search input:focus{

    outline:none;

    border-color:var(--blue);

}

.toolbar-controls{

    display:flex;

    gap:12px;

}

.toolbar select{

    background:var(--panel);

    color:white;

    border:1px solid var(--border);

    padding:12px 16px;

    border-radius:8px;

}
/* Country Gri */

.country-grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(360px,1fr));
    gap:24px;
    margin-bottom:40px;
}

.country-card{

    background:var(--panel);

    border:1px solid var(--border);

    border-radius:var(--radius);

    overflow:hidden;

    transition:
        transform .18s ease,
        border-color .18s ease,
        box-shadow .18s ease;

    box-shadow:var(--shadow);

}

.country-card:hover{

    transform:translateY(-4px);

    border-color:#3b82f6;

    box-shadow:
        0 14px 40px rgba(0,0,0,.45);

}

.country-header{

    display:flex;

    justify-content:space-between;

    align-items:flex-start;

    padding:22px;

    border-bottom:1px solid var(--border);

}

.country-title{

    display:flex;

    flex-direction:column;

    gap:6px;

}

.country-title h3{

    font-size:1.35rem;

    font-weight:700;

}

.country-code{

    font-size:.78rem;

    color:var(--muted);

    letter-spacing:.15em;

}

.country-rank{

    text-align:right;

}

.country-rank label{

    display:block;

    color:var(--muted);

    font-size:.75rem;

    text-transform:uppercase;

    margin-bottom:4px;

}

.country-rank span{

    font-size:1.25rem;

    font-weight:700;

}

/*  Debt Display  */

.debt-display{

    padding:24px;

}

.debt-label{

    color:var(--muted);

    text-transform:uppercase;

    font-size:.78rem;

    margin-bottom:10px;

}

.debt-value{

    font-size:2rem;

    font-weight:700;

    font-family:
        Consolas,
        Monaco,
        monospace;

    color:var(--green);

    word-break:break-word;

}

.debt-updated{

    margin-top:8px;

    color:var(--muted);

    font-size:.78rem;

}

/* Statistics Grid */

.country-stats{

    display:grid;

    grid-template-columns:repeat(2,1fr);

    gap:18px;

    padding:24px;

    border-top:1px solid var(--border);

}

.stat{

    display:flex;

    flex-direction:column;

    gap:4px;

}

.stat label{

    color:var(--muted);

    font-size:.74rem;

    text-transform:uppercase;

    letter-spacing:.08em;

}

.stat span{

    font-weight:600;

    font-size:1rem;

}

.stat-positive{

    color:var(--green);

}

.stat-warning{

    color:var(--yellow);

}

.stat-negative{

    color:var(--red);

}

.stat-neutral{

    color:var(--blue);

}

/* footer */

.country-footer{

    display:flex;

    justify-content:space-between;

    align-items:center;

    gap:20px;

    padding:18px 24px;

    border-top:1px solid var(--border);

    color:var(--muted);

    font-size:.78rem;
}

.source{

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.updated{

    font-family:
        Consolas,
        monospace;
}

/* Data Table */

.table-wrapper{

    background:var(--panel);

    border:1px solid var(--border);

    border-radius:var(--radius);

    overflow:hidden;

    box-shadow:var(--shadow);

}

.data-table{

    width:100%;

}

.data-table thead{

    background:#172132;

}

.data-table th{

    padding:16px;

    text-align:left;

    color:var(--muted);

    font-size:.82rem;

    text-transform:uppercase;

    letter-spacing:.06em;

    position:sticky;

    top:0;

    z-index:2;

}

.data-table td{

    padding:16px;

    border-top:1px solid var(--border);

}

.data-table tbody tr{

    transition:background .15s ease;

}

.data-table tbody tr:hover{

    background:#182536;

}

.data-table td.number{

    text-align:right;

    font-family:
        Consolas,
        Monaco,
        monospace;

    font-weight:600;
}

.data-table td.country{

    font-weight:600;
}

.data-table td.rank{

    color:var(--blue);

    font-weight:700;
}

.data-table td.good{

    color:var(--green);
}

.data-table td.bad{

    color:var(--red);
}

.data-table td.warn{

    color:var(--yellow);
}
/* ==========================================================
   Status Badges
   ========================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 4px 10px;

    border-radius: 999px;

    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;

    border: 1px solid transparent;
}

.badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.badge-live {
    background: rgba(34,197,94,.10);
    color: #4ade80;
    border-color: rgba(34,197,94,.25);
}

.badge-live::before {
    background: #22c55e;
}

.badge-loading {
    background: rgba(245,158,11,.10);
    color: #fbbf24;
    border-color: rgba(245,158,11,.25);
}

.badge-loading::before {
    background: #f59e0b;
}

.badge-error {
    background: rgba(239,68,68,.10);
    color: #f87171;
    border-color: rgba(239,68,68,.25);
}

.badge-error::before {
    background: #ef4444;
}

.badge-offline {
    background: rgba(100,116,139,.15);
    color: #cbd5e1;
    border-color: rgba(148,163,184,.25);
}

.badge-offline::before {
    background: #94a3b8;
}

/* ==========================================================
   Loading Skeleton
   ========================================================== */

.skeleton {

    position: relative;

    overflow: hidden;

    background: #1e293b;

    color: transparent !important;

    border-radius: 6px;

}

.skeleton::after {

    content: "";

    position: absolute;

    inset: 0;

    transform: translateX(-100%);

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255,255,255,.08),
            transparent
        );

    animation: skeleton-loading 1.2s infinite;

}

@keyframes skeleton-loading {

    to {

        transform: translateX(100%);

    }

}

/* ==========================================================
   Scrollbars
   ========================================================== */

::-webkit-scrollbar {

    width: 12px;

    height: 12px;

}

::-webkit-scrollbar-track {

    background: #0f172a;

}

::-webkit-scrollbar-thumb {

    background: #334155;

    border-radius: 999px;

}

::-webkit-scrollbar-thumb:hover {

    background: #475569;

}

/* Firefox */

* {

    scrollbar-width: thin;

    scrollbar-color: #475569 #0f172a;

}

/* ==========================================================
   Search Highlight
   ========================================================== */

mark {

    background: rgba(59,130,246,.25);

    color: white;

    padding: 1px 3px;

    border-radius: 3px;

}

/* ==========================================================
   Empty State
   ========================================================== */

.empty-state {

    text-align: center;

    padding: 80px 24px;

    color: var(--muted);

}

.empty-state h2 {

    margin-bottom: 10px;

    font-size: 1.4rem;

}

.empty-state p {

    max-width: 550px;

    margin: auto;

    line-height: 1.7;

}

/* ==========================================================
   Error Panel
   ========================================================== */

.error-panel {

    background: rgba(127,29,29,.25);

    border: 1px solid rgba(239,68,68,.35);

    color: #fecaca;

    border-radius: var(--radius);

    padding: 18px;

    margin-bottom: 24px;

}

.error-panel h3 {

    margin-bottom: 8px;

}

/* ==========================================================
   API Feed Indicator
   ========================================================== */

.feed-status {

    display: flex;

    align-items: center;

    gap: 8px;

    font-size: .85rem;

    color: var(--muted);

}

.feed-light {

    width: 9px;

    height: 9px;

    border-radius: 50%;

    background: var(--green);

    animation: pulse 2s infinite;

}

/* ==========================================================
   Utility Classes
   ========================================================== */

.hidden {
    display: none !important;
}

.center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.text-green {
    color: var(--green);
}

.text-red {
    color: var(--red);
}

.text-yellow {
    color: var(--yellow);
}

.text-blue {
    color: var(--blue);
}

.text-muted {
    color: var(--muted);
}

.mono {
    font-family:
        Consolas,
        Monaco,
        monospace;
}

.bold {
    font-weight: 700;
}

/* Animations  */

.fade-in {

    animation: fadeIn .35s ease;

}

@keyframes fadeIn {

    from {

        opacity: 0;

        transform: translateY(8px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }

}

.slide-up {

    animation: slideUp .30s ease;

}

@keyframes slideUp {

    from {

        opacity: 0;

        transform: translateY(24px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }

}
