:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-card: #1c2128;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-orange: #d29922;
    --accent-red: #f85149;
    --accent-purple: #a371f7;
    --border-color: #30363d;
    --code-bg: #0d1117;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    scroll-behavior: smooth;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 48px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.site-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(88, 166, 255, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(163, 113, 247, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.site-header h1 {
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    position: relative;
}

.site-header .subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.lang-switch {
    position: absolute;
    top: 20px;
    right: 24px;
    display: flex;
    gap: 12px;
    font-size: 0.875rem;
}

.lang-switch a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.lang-switch a:hover {
    color: var(--accent-blue);
}

.lang-switch .current-lang {
    color: var(--text-primary);
    font-weight: 500;
}

.lang-switch .nav-link {
    color: var(--accent-orange);
    font-weight: 500;
}

.lang-switch .nav-link:hover {
    color: var(--text-primary);
}

/* Search Section */
.search-section {
    padding: 32px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 14px 20px;
    font-size: 1rem;
    font-family: var(--font-sans);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.filter-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-tag {
    padding: 8px 16px;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-tag:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.filter-tag.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: var(--bg-primary);
    font-weight: 500;
}

/* Intro Section */
.intro-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 32px;
}

.intro-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.intro-section p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.format-box {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px;
}

.format-box h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rtsp-code {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    color: var(--accent-green);
    word-break: break-all;
    background: transparent;
}

/* Cameras Grid */
.cameras-grid {
    display: grid;
    grid-template-columns: 340px;
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

@media (min-width: 740px) {
    .cameras-grid {
        grid-template-columns: repeat(2, 340px);
    }
}

@media (min-width: 1140px) {
    .cameras-grid {
        grid-template-columns: repeat(3, 340px);
    }
}

@media (min-width: 1510px) {
    .cameras-grid {
        grid-template-columns: repeat(4, 340px);
    }
}

.camera-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.camera-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.camera-card:hover {
    border-color: var(--text-muted);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.camera-card:hover::before {
    opacity: 1;
}

.camera-card.hidden {
    display: none;
}

.camera-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
    margin-bottom: 12px;
}

.camera-badge.pro {
    background: rgba(88, 166, 255, 0.15);
    color: var(--accent-blue);
}

.camera-badge.consumer {
    background: rgba(63, 185, 80, 0.15);
    color: var(--accent-green);
}

.camera-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.camera-card .description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.urls-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.url-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--code-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.url-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 70px;
}

.url-item code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--accent-green);
    word-break: break-all;
    flex: 1;
    line-height: 1.5;
}

.copy-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.copy-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: var(--bg-primary);
}

.copy-btn.copied {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: var(--bg-primary);
}

.code-block {
    display: block;
    padding: 16px;
    margin: 12px 0;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--accent-green);
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    white-space: pre;
}

.code-block code {
    color: var(--accent-green);
}

.intro-section h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 20px;
    margin-bottom: 8px;
}

.intro-section ul {
    list-style: disc;
    padding-left: 20px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-list {
    list-style: none;
    padding-left: 0;
}

.link-list a {
    color: var(--accent-blue);
    text-decoration: none;
}

.link-list a:hover {
    text-decoration: underline;
}

.links-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.link-btn {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.link-btn:hover {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

.frigate-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.frigate-config {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.frigate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.frigate-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-orange);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.frigate-toggle-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.frigate-toggle-btn:hover {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    color: var(--bg-primary);
}

.frigate-code {
    display: block;
    margin: 0;
    padding: 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent-green);
    background: transparent;
    overflow-x: auto;
    white-space: pre;
}

.frigate-code.hidden {
    display: none;
}

.frigate-copy-btn {
    margin: -4px 12px 12px 12px;
}

/* Info Section */
.info-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 32px;
}

.info-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.info-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-section li {
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
}

.info-section li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: 600;
}

.info-section code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-orange);
}

/* Tools Section */
.tools-section {
    margin-bottom: 48px;
}

.tools-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
}

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

.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.25s ease;
}

.tool-card:hover {
    border-color: var(--text-muted);
}

.tool-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.tool-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.tool-card a {
    display: inline-block;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--accent-blue);
    color: var(--bg-primary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tool-card a:hover {
    background: var(--text-primary);
}

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

.site-footer p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .site-header h1 {
        font-size: 2rem;
    }

    .site-header .subtitle {
        font-size: 1rem;
    }

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

    .intro-section,
    .info-section {
        padding: 24px;
    }

    .filter-tags {
        gap: 6px;
    }

    .filter-tag {
        padding: 6px 12px;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .site-header {
        padding: 32px 0;
    }

    .container {
        padding: 0 16px;
    }
}