/* ===== CSS Reset & Variables ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #e8ecf4;
    --bg-secondary: #dfe4ef;
    --glass-bg: rgba(255, 255, 255, 0.55);
    --glass-border: rgba(255, 255, 255, 0.7);
    --glass-shadow: rgba(140, 150, 180, 0.18);
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --accent-pink: #c026a3;
    --accent-green: #15803d;
    --accent-orange: #c2410c;
    --accent-cyan: #0e7490;
    --hero-glow: rgba(59, 114, 233, 0.12);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* ===== Base Styles ===== */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

/* ===== Animated Background ===== */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s ease-in-out infinite;
}

.bg-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(59, 114, 233, 0.2), transparent 70%);
    top: -10%;
    left: -5%;
    animation-duration: 25s;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.18), transparent 70%);
    top: 40%;
    right: -10%;
    animation-duration: 20s;
    animation-delay: -5s;
}

.bg-orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(217, 70, 168, 0.15), transparent 70%);
    bottom: -5%;
    left: 20%;
    animation-duration: 22s;
    animation-delay: -10s;
}

.bg-orb-4 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(8, 145, 178, 0.15), transparent 70%);
    top: 60%;
    left: 50%;
    animation-duration: 18s;
    animation-delay: -3s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 50px) scale(0.95); }
    75% { transform: translate(30px, 20px) scale(1.02); }
}

/* ===== Container ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

/* ===== Glass Card ===== */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px var(--glass-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(140, 150, 180, 0.25);
}

/* ===== Header ===== */
.header {
    text-align: center;
    padding: 32px 0 24px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo i {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.apps-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 2px 10px rgba(59, 114, 233, 0.25);
}

.apps-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(59, 114, 233, 0.35);
}

.apps-link i {
    font-size: 0.78rem;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 6px;
    font-weight: 400;
}

/* ===== Hero Card (IP Display) ===== */
.hero-card {
    text-align: center;
    padding: 40px 24px 32px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(59, 114, 233, 0.08), rgba(139, 92, 246, 0.06));
    border-color: rgba(59, 114, 233, 0.15);
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-blue), var(--accent-purple), transparent);
}

.hero-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 12px;
}

.hero-ip {
    font-family: var(--font-mono);
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    word-break: break-all;
    margin-bottom: 16px;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid rgba(30, 41, 59, 0.12);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.copy-btn:hover {
    background: rgba(59, 114, 233, 0.12);
    color: var(--accent-blue);
    border-color: rgba(59, 114, 233, 0.3);
}

.hero-hostname {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.hero-hostname i {
    margin-right: 6px;
    color: var(--accent-cyan);
}

/* ===== Cards Grid ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.info-card {
    padding: 24px;
}

.info-card.full-width {
    grid-column: 1 / -1;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.location-icon {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
}

.network-icon {
    background: rgba(79, 143, 252, 0.15);
    color: var(--accent-blue);
}

.device-icon {
    background: rgba(168, 85, 247, 0.15);
    color: var(--accent-purple);
}

.ua-icon {
    background: rgba(236, 72, 153, 0.15);
    color: var(--accent-pink);
}

.curl-icon {
    background: rgba(249, 115, 22, 0.15);
    color: var(--accent-orange);
}

.headers-icon {
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-cyan);
}

/* ===== Info Rows ===== */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(30, 41, 59, 0.08);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    flex-shrink: 0;
    margin-right: 12px;
}

.info-value {
    font-size: 0.88rem;
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 6px;
}

.truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.country-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-yes {
    background: rgba(34, 197, 94, 0.15);
    color: var(--accent-green);
}

.badge-no {
    background: rgba(30, 41, 59, 0.06);
    color: var(--text-muted);
}

/* ===== User Agent Display ===== */
.ua-display {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-primary);
    background: rgba(30, 41, 59, 0.05);
    border: 1px solid rgba(30, 41, 59, 0.08);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    word-break: break-all;
    line-height: 1.7;
}

/* ===== Curl Section ===== */
.curl-section {
    padding: 24px;
    margin-bottom: 24px;
}

.curl-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 20px;
}

.curl-desc strong {
    color: var(--accent-orange);
}

.curl-examples {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.curl-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.curl-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.curl-command {
    display: flex;
    align-items: center;
    background: rgba(30, 41, 59, 0.06);
    border: 1px solid rgba(30, 41, 59, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.curl-command code {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: #166534;
    padding: 10px 12px;
    white-space: nowrap;
    overflow-x: auto;
}

.copy-cmd-btn {
    padding: 10px 12px;
    background: none;
    border: none;
    border-left: 1px solid rgba(30, 41, 59, 0.1);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.copy-cmd-btn:hover {
    color: var(--accent-blue);
    background: rgba(59, 114, 233, 0.08);
}

/* ===== Headers Section ===== */
.headers-section {
    padding: 24px;
    margin-bottom: 24px;
}

.clickable {
    cursor: pointer;
    user-select: none;
}

.clickable:hover h2 {
    color: var(--accent-cyan);
}

.toggle-icon {
    margin-left: auto;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.headers-body {
    margin-top: 16px;
}

.headers-table {
    background: rgba(30, 41, 59, 0.04);
    border: 1px solid rgba(30, 41, 59, 0.08);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.header-row {
    display: flex;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(30, 41, 59, 0.06);
    font-size: 0.82rem;
    gap: 12px;
}

.header-row:last-child {
    border-bottom: none;
}

.header-row:nth-child(even) {
    background: rgba(30, 41, 59, 0.03);
}

.header-key {
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-weight: 500;
    min-width: 160px;
    flex-shrink: 0;
}

.header-value {
    font-family: var(--font-mono);
    color: var(--text-primary);
    word-break: break-all;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.footer a {
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer a:hover {
    color: var(--accent-purple);
}

.footer-sub {
    margin-top: 4px;
    font-size: 0.75rem;
}

.footer-sub code {
    font-family: var(--font-mono);
    background: rgba(30, 41, 59, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent-blue);
    color: #fff;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(59, 114, 233, 0.25);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== Responsive Design ===== */

/* Tablet */
@media (max-width: 768px) {
    .container {
        padding: 16px 14px 32px;
    }

    .hero-ip {
        font-size: 2.2rem;
    }

    .hero-card {
        padding: 30px 18px 24px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .curl-examples {
        grid-template-columns: 1fr;
    }

    .truncate {
        max-width: 150px;
    }

    .bg-orb {
        filter: blur(60px);
        opacity: 0.35;
    }

    .bg-orb-1 { width: 300px; height: 300px; }
    .bg-orb-2 { width: 250px; height: 250px; }
    .bg-orb-3 { width: 200px; height: 200px; }
    .bg-orb-4 { width: 180px; height: 180px; }
}

/* Mobile small */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 12px 10px 24px;
    }

    .header {
        padding: 20px 0 16px;
    }

    .logo {
        font-size: 1.6rem;
    }

    .hero-ip {
        font-size: 1.7rem;
    }

    .hero-card {
        padding: 24px 14px 20px;
        border-radius: var(--radius-sm);
    }

    .glass-card {
        border-radius: var(--radius-sm);
    }

    .info-card {
        padding: 18px;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 8px 0;
    }

    .info-value {
        text-align: left;
    }

    .truncate {
        max-width: 100%;
    }

    .header-row {
        flex-direction: column;
        gap: 4px;
    }

    .header-key {
        min-width: auto;
    }

    .curl-section {
        padding: 18px;
    }

    .headers-section {
        padding: 18px;
    }

    .hero-hostname {
        font-size: 0.75rem;
    }
}

/* Large screens */
@media (min-width: 1200px) {
    .container {
        max-width: 1080px;
    }

    .bg-orb-1 { width: 600px; height: 600px; }
    .bg-orb-2 { width: 500px; height: 500px; }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-card { animation: fadeInUp 0.6s ease-out; }
.info-card:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.1s both; }
.info-card:nth-child(2) { animation: fadeInUp 0.6s ease-out 0.2s both; }
.info-card:nth-child(3) { animation: fadeInUp 0.6s ease-out 0.3s both; }
.info-card:nth-child(4) { animation: fadeInUp 0.6s ease-out 0.4s both; }
.curl-section { animation: fadeInUp 0.6s ease-out 0.5s both; }
.headers-section { animation: fadeInUp 0.6s ease-out 0.6s both; }

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

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(30, 41, 59, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(30, 41, 59, 0.25);
}

/* ===== Selection ===== */
::selection {
    background: rgba(59, 114, 233, 0.2);
    color: #1e293b;
}