/*
   WHOIS LOOKUP - EXPERT WEB TOOLS
*/

@font-face { font-family: 'Inter';    src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter';    src: url('/fonts/inter-v20-latin-600.woff2')     format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('/fonts/orbitron-v35-latin-700.woff2')  format('woff2'); font-weight: 700; font-display: swap; }

:root {
    --bg-dark:          #0a0a0f;
    --primary-accent:   #3b82f6;
    --secondary-accent: #8b5cf6;
    --success:          #10b981;
    --warning:          #f59e0b;
    --danger:           #ef4444;
    --text-main:        #ffffff;
    --text-muted:       #94a3b8;
    --card-bg:          rgba(25, 25, 35, 0.6);
    --card-border:      rgba(255, 255, 255, 0.08);
    --font-heading:     'Orbitron', sans-serif;
    --font-body:        'Inter', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; max-width: 100vw; overflow-x: hidden; }
body { background-color: var(--bg-dark); color: var(--text-main); font-family: var(--font-body); min-height: 100vh; display: flex; flex-direction: column; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
.background-glow { position: fixed; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle at center, rgba(59,130,246,0.08) 0%, rgba(10,10,15,0) 50%); z-index: -1; pointer-events: none; }

/* --- Header --- */
.tool-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 5%; max-width: 1400px; margin: 0 auto; width: 100%; }
.back-btn { color: var(--text-muted); text-decoration: none; display: flex; align-items: center; gap: 8px; transition: color 0.3s; border-radius: 4px; padding: 2px 4px; }
.back-btn:hover { color: var(--primary-accent); }
.back-btn:focus-visible { outline: 2px solid var(--primary-accent); color: var(--primary-accent); }
.logo { font-family: var(--font-heading); font-size: 1.2rem; }
.logo span { color: var(--primary-accent); }

/* --- Tool Intro --- */
.tool-intro { text-align: center; margin-bottom: 2rem; padding: 0 5%; }
.tool-intro h1 { font-family: var(--font-heading); font-size: 2rem; margin-bottom: 0.5rem; }
.tool-intro p  { color: var(--text-muted); }

/* --- Main --- */
.main-content { flex-grow: 1; padding: 2rem 5%; max-width: 1400px; margin: 0 auto; width: 100%; }

/* --- Search Bar --- */
.search-bar-container { display: flex; gap: 10px; margin-bottom: 1rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.lookup-form { flex: 1; display: flex; gap: 10px; }
.input-wrapper { flex: 1; position: relative; background: rgba(255,255,255,0.05); border: 1px solid var(--card-border); border-radius: 8px; display: flex; align-items: center; transition: border-color 0.2s; }
.input-wrapper:focus-within { border-color: var(--primary-accent); }
.input-wrapper i { margin-left: 15px; color: var(--text-muted); flex-shrink: 0; }
.input-wrapper input { background: transparent; border: none; color: #fff; width: 100%; padding: 12px 15px; font-size: 1rem; outline: none; font-family: var(--font-body); }
.input-wrapper input:focus-visible { outline: none; }
#lookupButton { background: var(--primary-accent); color: #fff; padding: 0 20px; border: 1px solid var(--primary-accent); border-radius: 8px; font-weight: 600; cursor: pointer; transition: background 0.2s, opacity 0.2s; white-space: nowrap; font-family: var(--font-body); }
#lookupButton:hover { background: #2563eb; }
#lookupButton:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
#lookupButton:disabled { opacity: 0.55; cursor: not-allowed; background: #1e40af; border-color: #1e40af; }

/* --- Example Chips --- */
.example-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }
.chip-label { color: var(--text-muted); font-size: 0.85rem; flex-shrink: 0; }
.chip { background: rgba(255,255,255,0.05); border: 1px solid var(--card-border); color: var(--text-muted); padding: 4px 12px; border-radius: 20px; font-size: 0.83rem; cursor: pointer; transition: all 0.2s; font-family: var(--font-body); }
.chip:hover { background: var(--primary-accent); border-color: var(--primary-accent); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--primary-accent); outline-offset: 2px; }

/* --- Banners --- */
.error-banner { background: rgba(239,68,68,0.1);  color: #f87171; border: 1px solid rgba(239,68,68,0.2);  padding: 1rem; border-radius: 8px; margin-bottom: 1.5rem; text-align: center; font-size: 0.9rem; }
.info-banner  { background: rgba(59,130,246,0.1); color: #93c5fd; border: 1px solid rgba(59,130,246,0.2); padding: 0.85rem 1rem; border-radius: 8px; margin-bottom: 1rem; text-align: center; font-size: 0.88rem; }

/* --- Bento Grid --- */
.bento-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 2rem; }

/* --- Cards --- */
.card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 16px; padding: 1.5rem; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 1rem; }
.card-header { font-family: var(--font-heading); color: var(--text-muted); font-size: 0.9rem; display: flex; align-items: center; text-transform: uppercase; letter-spacing: 1px; gap: 8px; }
.card-header i { color: var(--primary-accent); }
.header-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }

/* --- Hero Card --- */
.hero-card { grid-column: span 2; }
#heroDomainName { font-family: var(--font-heading); font-size: 1.1rem; color: #fff; word-break: break-all; min-width: 0; }

/* Availability badge */
.avail-badge { font-family: var(--font-body); font-size: 0.75rem; padding: 3px 10px; border-radius: 4px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.avail-badge.registered { background: rgba(239,68,68,0.15);  color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.avail-badge.available  { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }

/* Status list */
.domain-status-wrapper { display: flex; flex-direction: column; gap: 6px; }
.status-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.status-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.status-pill { font-size: 0.78rem; padding: 2px 8px; border-radius: 4px; background: rgba(59,130,246,0.1); color: #93c5fd; border: 1px solid rgba(59,130,246,0.25); font-family: var(--font-body); white-space: nowrap; }
.status-pill.status-ok      { background: rgba(16,185,129,0.1);  color: #6ee7b7; border-color: rgba(16,185,129,0.25); }
.status-pill.status-warning { background: rgba(245,158,11,0.1);  color: #fcd34d; border-color: rgba(245,158,11,0.25); }

/* Expiry row */
.expiry-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin-top: auto; background: rgba(255,255,255,0.03); border: 1px solid var(--card-border); border-radius: 10px; padding: 0.75rem 1rem; }
.expiry-item { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 70px; padding: 0.25rem 0.5rem; }
.expiry-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.expiry-value { font-size: 0.9rem; font-weight: 600; color: #fff; text-align: center; }
.expiry-value.expiry-soon   { color: var(--warning); }
.expiry-value.expiry-urgent { color: var(--danger); }
.expiry-divider { width: 1px; height: 36px; background: var(--card-border); flex-shrink: 0; }

/* --- Detail Lists --- */
.detail-list { list-style: none; padding: 0; display: flex; flex-direction: column; }
.detail-list li { display: flex; justify-content: space-between; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.9rem; gap: 12px; }
.detail-list li:last-child { border-bottom: none; }
.detail-list li > span:first-child { color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.detail-list li > span:last-child, .detail-list li > a { min-width: 0; word-break: break-all; text-align: right; }
.detail-link { color: var(--primary-accent); text-decoration: none; }
.detail-link:hover { text-decoration: underline; }
.detail-link:focus-visible { outline: 2px solid var(--primary-accent); outline-offset: 2px; }
.ns-list li { justify-content: flex-start; gap: 8px; }
.ns-list li > span:last-child { text-align: left; font-size: 0.88rem; font-family: monospace; color: #e2e8f0; }
.redacted-label { color: var(--text-muted); font-style: italic; font-size: 0.85rem; }

/* --- Available Card --- */
.available-card {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    background: rgba(16,185,129,0.07);
    border: 1px solid rgba(16,185,129,0.2);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}
.available-card > i {
    font-size: 2rem;
    color: var(--success);
    flex-shrink: 0;
    width: 2rem;
    text-align: center;
    margin-top: 4px;
}
.available-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.available-content strong {
    font-size: 1.2rem;
    font-family: var(--font-heading);
    word-break: break-all;
}
.available-content > span {
    color: var(--text-muted);
    font-size: 0.95rem;
}
/* Explicit styles for anchor CTA — do not rely on .tool-btn cascade */
a.available-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    align-self: flex-start;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
a.available-cta:hover { background: var(--primary-accent); border-color: var(--primary-accent); }
a.available-cta:focus-visible { outline: 2px solid var(--primary-accent); outline-offset: 2px; }

/* --- Actions --- */
.actions-row { text-align: center; margin: 0 0 2rem; }
.tool-btn { padding: 12px 24px; background: rgba(255,255,255,0.05); color: #fff; font-size: 1rem; border: 1px solid var(--card-border); border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); text-decoration: none; }
.tool-btn:hover { background: var(--primary-accent); border-color: var(--primary-accent); }
.tool-btn:focus-visible { outline: 2px solid var(--primary-accent); outline-offset: 2px; }

/* --- Toast --- */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1e1e24; border: 1px solid var(--primary-accent); color: #fff; padding: 10px 20px; border-radius: 8px; z-index: 2000; box-shadow: 0 4px 12px rgba(0,0,0,0.5); font-size: 0.9rem; pointer-events: none; white-space: nowrap; opacity: 0; transition: opacity 0.3s; }
.toast.toast-visible { opacity: 1; }
.hidden { display: none !important; }

/* --- Info Section --- */
.info-section { margin-top: 4rem; padding: 0 1rem; }
.info-section h2 { font-family: var(--font-heading); color: var(--text-main); margin-bottom: 2rem; font-size: 1.5rem; text-align: center; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.info-grid h3 { color: #60a5fa; font-family: var(--font-heading); font-size: 1rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 8px; }
.info-grid p  { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }
.faq-container { margin-top: 2rem; }
.faq-container h3 { font-family: var(--font-heading); color: var(--text-main); margin: 1.5rem 0 1rem; }
.faq-container h4 { color: var(--secondary-accent); font-size: 1rem; margin-bottom: 0.5rem; margin-top: 1.5rem; }
.faq-container p  { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1rem; line-height: 1.6; }

/* --- Footer --- */
footer { text-align: center; padding: 3rem 0; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid var(--card-border); margin-top: 3rem; }
footer a { color: #e2e8f0; text-decoration: underline; }
footer a:hover { color: #fff; }

/* --- Responsive --- */
@media (max-width: 992px) {
    .bento-grid { grid-template-columns: 1fr 1fr; }
    .hero-card  { grid-column: span 2; }
}
@media (max-width: 600px) {
    .bento-grid { grid-template-columns: 1fr; }
    .hero-card  { grid-column: span 1; }
    .search-bar-container { flex-direction: column; }
    .lookup-form { flex-direction: column; }
    #lookupButton { width: 100%; padding: 12px; }
    .tool-intro h1 { font-size: 1.6rem; }
    .expiry-item { padding: 0.25rem; }
    .expiry-value { font-size: 0.8rem; }
    .expiry-label { font-size: 0.65rem; }
    .available-card { flex-direction: column; gap: 1rem; }
    a.available-cta { align-self: stretch; justify-content: center; }
}
@media (max-width: 480px) {
    .tool-header, .main-content, .tool-intro { padding: 1rem; }
    .tool-intro h1 { font-size: 1.4rem; }
    .card { padding: 1rem; }
    #heroDomainName { font-size: 0.95rem; }
    .example-chips { gap: 6px; }
}
@media (max-width: 360px) {
    .tool-intro h1 { font-size: 1.2rem; }
    .expiry-divider { display: none; }
    .expiry-row { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}