/* Sentry - Network Privacy Checker */
/* Clean, Professional Design */

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('../fonts/ibm-plex-mono-400-subset.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('../fonts/ibm-plex-mono-600-subset.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('../fonts/ibm-plex-mono-700-subset.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* Professional dark theme */
    --bg-primary: #050508;
    --bg-secondary: #0a0a0f;
    --bg-tertiary: #12121a;
    --bg-card: rgba(18, 18, 26, 0.85);
    --bg-card-hover: rgba(26, 26, 38, 0.9);

    /* Text hierarchy */
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --text-subtle: #505050;

    /* Accent colors */
    --accent-primary: #00ff88;
    --accent-secondary: #00d4ff;
    --accent-tertiary: #ff6b35;
    --accent-quaternary: #a855f7;

    /* Status colors */
    --success: #00ff88;
    --warning: #ffaa00;
    --danger: #ff3366;
    --info: #00d4ff;
    --purple: #a855f7;
    --dim: #505050;

    /* Borders and glows */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 255, 136, 0.3);
    --border-active: rgba(0, 255, 136, 0.5);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.4);

    --shadow-glow-sm: 0 0 12px rgba(0, 255, 136, 0.15);
    --shadow-glow-md: 0 0 24px rgba(0, 255, 136, 0.25);
    --shadow-glow-lg: 0 0 36px rgba(0, 255, 136, 0.35);

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    /* Transitions */
    --transition-fast: 100ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Subtle noise texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

/* Subtle grid background */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 255, 136, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 136, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* Logo text — replaces glitch-effect */
.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(5, 5, 8, 0.5);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-slow);
}

.header.scrolled {
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
}

.logo-mark {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--bg-primary);
}


.header-actions {
    display: flex;
    gap: var(--space-3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    border: 1px solid transparent;
    font-family: inherit;
}

.btn-primary {
    background: var(--accent-primary);
    color: var(--bg-primary);
    box-shadow: var(--shadow-glow-sm);
}

.btn-primary:hover {
    background: var(--accent-secondary);
    box-shadow: var(--shadow-glow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Main content */
.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--space-20) + var(--space-8)) var(--space-6) var(--space-12);
    position: relative;
    z-index: 1;
}

/* Hero section */
.hero {
    text-align: center;
    margin-bottom: var(--space-12);
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-4);
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Tool description */
.tool-intro {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.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;
}

.faq-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-6);
    color: var(--text-primary);
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--space-6);
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.faq-question {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-3);
    color: var(--text-primary);
}

.faq-answer {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Status bar */
.status-bar {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 800px;
    margin: 0 auto var(--space-5);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-4) var(--space-6);
}

.status-bar-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    width: 100%;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.status-item:first-child {
    text-align: left;
}

.status-item:nth-child(2) {
    text-align: center;
}

.status-item:last-child {
    text-align: right;
}

.status-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
}

.status-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-value.online {
    color: var(--success);
}

.status-value.secure {
    color: var(--success);
}

.status-value.scanning {
    color: var(--info);
}

.status-value.danger {
    color: var(--danger);
}

.status-value.warning {
    color: var(--warning);
}

/* Privacy Card - Redesigned */
.privacy-card {
    max-width: 800px;
    margin: 0 auto var(--space-5);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    padding: var(--space-5);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.privacy-card-inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
}

.privacy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.privacy-title {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.privacy-content {
    display: flex;
    gap: var(--space-8);
    align-items: center;
}

.privacy-score-display {
    display: flex;
    gap: var(--space-6);
    align-items: center;
}

.score-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.score-ring-bg {
    fill: none;
    stroke: var(--bg-tertiary);
    stroke-width: 8;
}

.score-ring-fill {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 8;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-ring-fill.protected {
    stroke: var(--success);
}

.score-ring-fill.partial {
    stroke: var(--warning);
}

.score-ring-fill.exposed {
    stroke: var(--danger);
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.score-value.protected {
    color: var(--success);
}

.score-value.partial {
    color: var(--warning);
}

.score-value.exposed {
    color: var(--danger);
}

.privacy-details {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.privacy-verdict {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.privacy-verdict.protected {
    color: var(--success);
}

.privacy-verdict.partial {
    color: var(--warning);
}

.privacy-verdict.exposed {
    color: var(--danger);
}

.privacy-issues {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Grid layout */
.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-5);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    color: var(--accent-primary);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.history-clear {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.75rem;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: inherit;
    transition: all var(--transition-base);
    margin-left: auto;
}

.history-clear:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.card-content {
    padding: var(--space-5);
}

/* Data rows */
.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-color);
}

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

.data-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.data-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 60%;
    text-align: right;
}

.data-value.mono {
    font-family: 'IBM Plex Mono', monospace;
}

.data-value[data-copyable="true"] {
    cursor: pointer;
    transition: color var(--transition-fast);
}

.data-value[data-copyable="true"]:hover {
    color: var(--accent-primary);
}

.copy-flash {
    animation: copyFlash 0.3s ease-out;
}

@keyframes copyFlash {
    0%, 100% { background: transparent; }
    50% { background: rgba(0, 255, 136, 0.2); }
}

/* Progress bar */
.progress-bar {
    height: 4px;
    width: 100%;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--space-4);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-sm);
    transition: width var(--transition-base);
}



/* Test result */
.mono {
    font-family: 'IBM Plex Mono', monospace;
}


.privacy-protected {
    color: var(--success);
}

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

/* Ad placeholders */
.ad-placeholder {
    max-width: 800px;
    margin: 0 auto var(--space-5);
    background: var(--bg-card);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.ad-rectangle {
    height: 90px;
}

.show-desktop {
    display: none;
}

.map-container {
    width: 100%;
    height: 200px;
    margin-top: var(--space-3);
    border-radius: var(--radius-md);
    overflow: hidden;
}

/* Foldable sections */
.foldable {
    max-width: 800px;
    margin: 0 auto var(--space-5);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.foldable.collapsed .foldable-body {
    display: none;
}

.foldable-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-5);
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    user-select: none;
}

.foldable.collapsed .foldable-header {
    border-bottom: none;
}

.foldable-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    font-weight: 600;
}

.foldable-toggle {
    font-size: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}

.foldable-body {
    padding: var(--space-3) var(--space-5);
    font-size: 0.75rem;
    line-height: 1.6;
}

#scanLog .foldable-body {
    max-height: 300px;
    overflow-y: auto;
}

.output-line {
    color: var(--text-secondary);
    padding: 1px 0;
}

.output-line.success {
    color: var(--success);
}

.output-line.warning {
    color: var(--warning);
}

.output-line.error {
    color: var(--danger);
}

/* History list */
#scanHistoryPanel {
    max-width: 800px;
    margin: 0 auto var(--space-5);
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
}

.history-empty {
    text-align: center;
    padding: var(--space-6);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.history-entry {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: var(--space-4);
    padding: var(--space-3);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.history-entry:last-child {
    border-bottom: none;
}

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

.history-ip {
    font-family: 'IBM Plex Mono', monospace;
    color: var(--text-primary);
}

.history-isp {
    color: var(--text-secondary);
}

.history-verdict {
    font-weight: 600;
    text-align: right;
}

.history-verdict.protected {
    color: var(--success);
}

.history-verdict.partial {
    color: var(--warning);
}

.history-verdict.exposed {
    color: var(--danger);
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--space-8) var(--space-6);
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.footer-info {
    display: flex;
    justify-content: center;
    gap: var(--space-6);
    margin-bottom: var(--space-4);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.footer-version {
    font-size: 0.75rem;
    color: var(--text-subtle);
}

/* Responsive design */
@media (max-width: 768px) {
    .header-inner {
        padding: var(--space-3) var(--space-4);
    }

    .main {
        padding: calc(var(--space-16) + var(--space-4)) var(--space-4) var(--space-8);
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .status-bar {
        flex-direction: column;
        gap: var(--space-4);
        align-items: flex-start;
    }

    .privacy-content {
        flex-direction: column;
        text-align: center;
    }

    .privacy-score-display {
        flex-direction: column;
    }

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

    .history-entry {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .footer-info {
        flex-direction: column;
        gap: var(--space-2);
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Utility classes */
.tz-mismatch {
    color: var(--warning);
    font-weight: 600;
}