/* Utilo DNS — matched to utilo.ir dark theme
 * Palette: bg #1a1a1a, panels #2d2d2d/#252525, teal #0d7377, accent #14ffec
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

a { color: #14ffec; text-decoration: none; }
a:hover { color: #b8e6e8; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #2d2d2d;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* ---------- Header ---------- */
.header {
    background: #0d7377;
    color: #ffffff;
    padding: 30px;
    text-align: center;
    border-bottom: 3px solid #14ffec;
}
.header h1 {
    font-size: 2em;
    margin-bottom: 8px;
    font-weight: 700;
}
.header p {
    color: #b8e6e8;
    font-size: 1em;
}

/* ---------- Nav ---------- */
.main-nav {
    background: #252525;
    border-bottom: 2px solid #0d7377;
}
.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.main-nav a {
    display: block;
    padding: 15px 25px;
    color: #b8e6e8;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    font-weight: 600;
    transition: all 0.2s;
}
.main-nav a:hover {
    background: #1a1a1a;
    color: #14ffec;
}
.main-nav a.active {
    color: #14ffec;
    border-bottom-color: #14ffec;
    background: #1a1a1a;
}

/* ---------- Content ---------- */
.content-section {
    padding: 30px;
    background: #252525;
}

.intro {
    color: #b8e6e8;
    max-width: 75ch;
    margin: 0 auto 25px;
    text-align: center;
    font-size: 1.05em;
}

/* ---------- Search form ---------- */
.search-card {
    background: #1a1a1a;
    border: 2px solid #0d7377;
    border-radius: 8px;
    padding: 30px;
    max-width: 640px;
    margin: 0 auto 25px;
    text-align: center;
}
.search-card h2 {
    color: #14ffec;
    margin-bottom: 18px;
    font-size: 1.5em;
}
.search-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.search-row input[type=text] {
    flex: 1;
    padding: 12px 14px;
    background: #2d2d2d;
    color: #fff;
    border: 2px solid #0d7377;
    border-radius: 4px;
    font: 16px Menlo, Consolas, monospace;
}
.search-row input[type=text]::placeholder { color: #777; }
.search-row input[type=text]:focus { outline: 0; border-color: #14ffec; }

.btn-primary {
    background: #0d7377;
    color: #ffffff;
    border: 2px solid #14ffec;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary:hover {
    background: #14ffec;
    color: #0d7377;
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.examples {
    text-align: center;
    color: #b8e6e8;
    margin-top: 16px;
    font-size: 0.95em;
}
.examples a {
    background: #0d7377;
    color: #14ffec;
    padding: 4px 10px;
    border-radius: 4px;
    margin: 0 3px;
    display: inline-block;
    transition: all 0.2s;
}
.examples a:hover { background: #14ffec; color: #0d7377; }

.error {
    background: #3a1a1a;
    color: #ff8888;
    border-left: 4px solid #ff4444;
    padding: 12px 16px;
    margin: 16px auto;
    max-width: 640px;
    border-radius: 4px;
}

/* ---------- Results table (intoDNS-style) ---------- */
.result-header {
    text-align: center;
    margin-bottom: 20px;
}
.result-header h2 {
    color: #14ffec;
    font-size: 1.5em;
    margin-bottom: 4px;
}
.result-header .meta { color: #b8e6e8; font-size: 0.95em; }

table.tabular {
    width: 100%;
    border-collapse: collapse;
    background: #1a1a1a;
    border: 2px solid #0d7377;
    border-radius: 6px;
    overflow: hidden;
    font-size: 14px;
}
table.tabular thead th {
    background: #0d7377;
    color: #ffffff;
    text-align: left;
    padding: 12px 14px;
    font-weight: 700;
    border-bottom: 2px solid #14ffec;
}
table.tabular td {
    padding: 12px 14px;
    border-top: 1px solid #2d2d2d;
    vertical-align: top;
    color: #e0e0e0;
}
table.tabular tbody tr:hover td { background: #252525; }

.cat {
    font-weight: 700;
    font-size: 15px;
    color: #14ffec;
    background: #0d4d52 !important;
    width: 100px;
    text-align: center;
    vertical-align: top !important;
    padding-top: 18px !important;
    border-right: 2px solid #0d7377 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.icon {
    width: 36px;
    text-align: center;
    vertical-align: middle !important;
}
.ic {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
}
.ic-pass { background: #0d7377; color: #14ffec; }
.ic-warn { background: #5a3a00; color: #ffcc66; }
.ic-fail { background: #5a1a1a; color: #ff8888; }

.testname {
    width: 240px;
    font-weight: 600;
    color: #b8e6e8;
}
.info { color: #e0e0e0; }
.info code {
    font-family: Menlo, Consolas, monospace;
    background: #0d4d52;
    color: #14ffec;
    border: 1px solid #0d7377;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 13px;
    word-break: break-all;
}
.details {
    margin-top: 8px;
    font-size: 13px;
}
.details div { padding: 2px 0; }
.details strong { color: #b8e6e8; font-weight: 600; }

.geo-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    padding: 1px 6px 1px 6px;
    border-radius: 3px;
    background: #0d4d52;
    color: #b8e6e8;
    font-family: var(--mono, Menlo, Consolas, monospace);
    font-size: 0.85em;
    line-height: 1.4;
    cursor: help;
    vertical-align: middle;
    user-select: none;        /* keep it out of accidental selections */
    -webkit-user-select: none;
}
.geo-flag .flag-img {
    width: 18px;
    height: 13px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 1.5px;
    background: #2d2d2d;      /* placeholder if the SVG fails to load */
    display: block;           /* removes any inline whitespace */
}

.details--collapsible {
    margin-top: 8px;
    border: 1px solid #0d7377;
    border-radius: 4px;
    background: #181f1f;
    padding: 0;
}
.details--collapsible > summary {
    cursor: pointer;
    padding: 6px 10px;
    color: #14ffec;
    font-size: 12.5px;
    font-weight: 600;
    list-style: none;
    user-select: none;
}
.details--collapsible > summary::-webkit-details-marker { display: none; }
.details--collapsible > summary::before {
    content: '▸ ';
    display: inline-block;
    width: 1em;
    transition: transform 0.15s ease;
}
.details--collapsible[open] > summary::before { content: '▾ '; }
.details--collapsible > summary:hover { background: #0d4d52; }
.details--collapsible > div {
    padding: 4px 12px;
    border-top: 1px dashed #0d4d52;
}

.processed {
    margin: 20px 0 4px;
    color: #b8e6e8;
    font-size: 13px;
    text-align: center;
}

/* ---------- Footer ---------- */
.footer {
    padding: 16px 24px;
    color: #888;
    font-size: 13px;
    text-align: center;
    background: #1a1a1a;
    border-top: 1px solid #0d7377;
}

/* ---------- Loader overlay ---------- */
#utilo-loader {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 14, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
#utilo-loader.is-active { display: flex; }
.loader-card {
    background: #1a1a1a;
    border: 2px solid #0d7377;
    border-radius: 8px;
    padding: 36px 44px;
    max-width: 480px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}
.loader-card h3 {
    color: #14ffec;
    margin: 16px 0 8px;
    font-size: 1.2em;
}
.loader-card .loader-domain {
    color: #fff;
    font-family: Menlo, Consolas, monospace;
    background: #0d4d52;
    padding: 2px 8px;
    border-radius: 3px;
}
.loader-card p {
    color: #b8e6e8;
    font-size: 0.95em;
    margin: 0;
}
.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #0d4d52;
    border-top-color: #14ffec;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cached badge + JSON link ---------- */
.cached-badge {
    display: inline-block;
    background: #5a3a00;
    color: #ffcc66;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.85em;
    cursor: help;
}
.json-link a {
    background: #0d7377;
    color: #14ffec;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 0.9em;
}
.json-link a:hover { background: #14ffec; color: #0d7377; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    body { padding: 10px; }
    .header { padding: 20px; }
    .header h1 { font-size: 1.5em; }
    .main-nav a { padding: 12px 16px; }
    .content-section { padding: 18px; }
    .search-row { flex-direction: column; }
    .cat { width: 70px; font-size: 13px; }
    .testname { width: 140px; font-size: 13px; }
    table.tabular { font-size: 13px; }
}
