/* ============================================
   DOMAIN TOOLS HUB — Design System
   Color Accent: Greenish (Emerald/Teal)
   ============================================ */

:root {
    --bg-primary: #f0fdf4;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.82);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --border: rgba(16, 185, 129, 0.12);
    --border-subtle: rgba(0, 0, 0, 0.06);
    --text-primary: #064e3b;
    --text-secondary: #065f46;
    --text-body: #374151;
    --text-muted: #6b7280;
    --primary: #059669;
    --primary-light: #10b981;
    --primary-dark: #047857;
    --primary-glow: rgba(5, 150, 105, 0.18);
    --accent: #34d399;
    --accent-soft: rgba(52, 211, 153, 0.12);
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;
    --gradient: linear-gradient(135deg, #059669 0%, #10b981 40%, #34d399 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(5, 150, 105, 0.06) 0%, rgba(52, 211, 153, 0.03) 100%);
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(5, 150, 105, 0.06);
    --card-shadow-hover: 0 8px 32px rgba(5, 150, 105, 0.12);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 20px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-body);
    min-height: 100vh;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== Background ===== */
.bg-gradient {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 0%, rgba(52, 211, 153, 0.1) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 90%, rgba(5, 150, 105, 0.07) 0%, transparent 55%),
        radial-gradient(circle at 50% 40%, rgba(16, 185, 129, 0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.vector-decor {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

.vector-tl {
    top: -100px;
    left: -100px;
    width: 500px;
    height: 500px;
}

.vector-tr {
    top: -60px;
    right: -80px;
    width: 400px;
    height: 400px;
}

.vector-br {
    bottom: -40px;
    right: -40px;
    width: 300px;
    height: 300px;
    opacity: 0.3;
}

.container {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

/* ===== Header ===== */
header {
    padding: 1rem 0;
    background: rgba(240, 253, 244, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow 0.3s;
}

header.scrolled {
    box-shadow: 0 2px 20px rgba(5, 150, 105, 0.08);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.logo-icon {
    font-size: 1.4rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 3.5rem 0 2.5rem;
}

.hero h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 2rem;
    letter-spacing: 0.5px;
}

/* ===== Search Area ===== */
.search-area {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.domain-input-wrapper {
    width: 100%;
    position: relative;
}

.domain-input-wrapper textarea {
    width: 100%;
    padding: 1.1rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 500;
    text-align: center;
    resize: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.05);
    line-height: 1.4;
}

.domain-input-wrapper textarea::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.domain-input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow), 0 2px 8px rgba(5, 150, 105, 0.08);
}

.search-area button {
    padding: 0.85rem 2.5rem;
    background: var(--gradient);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-area button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.35);
}

.search-area button:active {
    transform: translateY(0);
}

.search-area button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    width: 18px;
    height: 18px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hidden {
    display: none !important;
}

/* ===== Results Section ===== */
.results {
    padding-bottom: 3rem;
    animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.results-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.domain-highlight {
    color: var(--primary);
    font-weight: 700;
}

.lookup-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== Tab Navigation ===== */
.tab-navigation {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tab-navigation::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
    position: relative;
}

.tab-btn:hover {
    color: var(--primary);
    border-color: rgba(5, 150, 105, 0.25);
    background: rgba(5, 150, 105, 0.04);
}

.tab-btn.active {
    color: white;
    background: var(--gradient);
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(5, 150, 105, 0.25);
}

.tab-btn .tab-icon {
    font-size: 0.95rem;
}

/* Loading indicator on tab button */
.tab-btn .tab-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 4px;
}

.tab-btn:not(.active) .tab-spinner {
    border-color: rgba(5,150,105,0.2);
    border-top-color: var(--primary);
}

/* ===== Tab Panel ===== */
.tab-panel {
    display: none;
    animation: fadeUp 0.3s ease;
}

.tab-panel.active {
    display: block;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s, border-color 0.3s;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(5, 150, 105, 0.2);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--gradient-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
}

.card-badge.success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
    border: 1px solid rgba(5, 150, 105, 0.25);
}

.card-badge.danger {
    background: rgba(220, 38, 38, 0.08);
    color: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.card-badge.warning {
    background: rgba(217, 119, 6, 0.08);
    color: var(--warning);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.card-body {
    padding: 1.5rem;
}

/* ===== Info Grid ===== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.85rem;
}

.info-item {
    padding: 1rem 1.1rem;
    background: rgba(5, 150, 105, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    transition: border-color 0.2s, transform 0.2s;
}

.info-item:hover {
    border-color: rgba(5, 150, 105, 0.2);
    transform: translateY(-1px);
}

.info-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.info-value {
    font-size: 0.92rem;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-all;
    line-height: 1.5;
}

.info-value.success { color: var(--success); }
.info-value.warning { color: var(--warning); }
.info-value.danger { color: var(--danger); }
.info-value.info { color: var(--info); }
.info-value.mono {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
}

/* ===== DNS Records Table ===== */
.dns-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.5rem;
}

.dns-table th,
.dns-table td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.dns-table th {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    background: rgba(5, 150, 105, 0.03);
}

.dns-table td {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.83rem;
    color: var(--text-body);
}

.dns-table tr:last-child td {
    border-bottom: none;
}

.dns-table tr:hover td {
    background: rgba(5, 150, 105, 0.02);
}

.record-type-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    background: var(--gradient);
    color: white;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}

/* ===== Propagation Grid ===== */
.propagation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.85rem;
}

.prop-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    background: rgba(5, 150, 105, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}

.prop-item:hover {
    border-color: rgba(5, 150, 105, 0.2);
    transform: translateY(-1px);
}

.prop-status {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.prop-status.resolved {
    background: rgba(5, 150, 105, 0.12);
    color: var(--success);
}

.prop-status.failed {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

.prop-details {
    flex: 1;
    min-width: 0;
}

.prop-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.prop-location {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.prop-ips {
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== SSL Section ===== */
.ssl-banner {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid;
}

.ssl-banner.valid {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.08) 0%, rgba(52, 211, 153, 0.03) 100%);
    border-color: rgba(5, 150, 105, 0.2);
}

.ssl-banner.invalid {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08) 0%, rgba(220, 38, 38, 0.02) 100%);
    border-color: rgba(220, 38, 38, 0.2);
}

.ssl-banner-icon {
    font-size: 2rem;
}

.ssl-banner-text h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.ssl-banner-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* SSL Chain */
.ssl-chain {
    margin-top: 1.25rem;
}

.ssl-chain h4 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chain-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(5, 150, 105, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    margin-bottom: 0.5rem;
    position: relative;
}

.chain-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 1.85rem;
    bottom: -0.5rem;
    width: 2px;
    height: 0.5rem;
    background: var(--border);
}

.chain-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.chain-info {
    flex: 1;
}

.chain-subject {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.chain-issuer {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ===== Technology Grid ===== */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: rgba(5, 150, 105, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}

.tech-item:hover {
    border-color: rgba(5, 150, 105, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.08);
}

.tech-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.tech-details {
    flex: 1;
    min-width: 0;
}

.tech-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.tech-category {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 500;
}

.tech-confidence {
    font-size: 0.68rem;
    padding: 0.12rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    flex-shrink: 0;
}

.tech-confidence.high {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success);
}

.tech-confidence.medium {
    background: rgba(217, 119, 6, 0.08);
    color: var(--warning);
}

/* ===== No Data / Empty ===== */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.empty-state .empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

/* ===== Skeleton Loading ===== */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.85rem;
}

.skeleton-grid::before,
.skeleton-grid::after {
    content: '';
    height: 60px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Error Message ===== */
.error-msg {
    padding: 1rem 1.25rem;
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero {
        padding: 2.5rem 0 2rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .propagation-grid {
        grid-template-columns: 1fr;
    }

    .tech-grid {
        grid-template-columns: 1fr;
    }

    .tab-navigation {
        gap: 0.25rem;
    }

    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .card-body {
        padding: 1rem;
    }

    .nav-links {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .domain-input-wrapper textarea {
        font-size: 1rem;
        padding: 0.9rem 1rem;
    }

    .search-area button {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(5, 150, 105, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(5, 150, 105, 0.35);
}
