:root {
    /* Color Palette */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, "Liberation Mono", Menlo, Courier, monospace;

    /* Light Theme (Default) */
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --text-main: #1a1a1a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --accent-color: #0f172a;

    --bg-active-tab: #eff6ff;
    --text-active-tab: #2563eb;

    /* Status Colors */
    --bg-null: #fef2f2;
    --text-null: #dc2626;
    --bg-empty: #fffbeb;
    --text-empty: #d97706;

    /* Spacing */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Layout */
    --sidebar-width: 300px;
    --header-height: 64px;
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --accent-color: #f8fafc;

    --bg-active-tab: #1e3a8a;
    --text-active-tab: #93c5fd;

    --bg-null: #450a0a;
    --text-null: #fca5a5;
    --bg-empty: #451a03;
    --text-empty: #fcd34d;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Welcome Overlay (Loading Screen) */
.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-body);
    /* Solid background, matches theme or use #000 */
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

[data-theme="dark"] .welcome-overlay {
    background: #0f172a;
    /* Ensure deep dark background */
}

/* Loader Animation */
.loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    display: inline-block;
    position: relative;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 2rem;
}

.loader::after {
    content: '';
    box-sizing: border-box;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom-color: var(--primary-color);
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.welcome-card {
    background: transparent;
    /* Remove card look */
    border: none;
    box-shadow: none;
    text-align: center;
    max-width: 600px;
    width: 100%;
    position: relative;
    animation: fadeIn 0.5s ease-in;
}

.welcome-card h2 {
    font-size: 1.75rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.welcome-quote {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: 3rem;
    line-height: 1.6;
}

.welcome-quote footer {
    display: block;
    font-size: 0.9rem;
    font-style: normal;
    margin-top: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.welcome-privacy {
    position: absolute;
    bottom: 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.skip-btn {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.skip-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Animations */
.fade-enter-active,
.fade-leave-active {
    transition: opacity 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[v-cloak] {
    display: none;
}

/* Header */
.app-header {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.logo .accent {
    color: var(--primary-color);
}

.tag {
    font-size: 0.75rem;
    background: var(--border-color);
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    margin-left: 8px;
    vertical-align: middle;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 4px;
    border-radius: var(--radius-sm);
}

/* Navigation Tabs */
.nav-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    overflow-x: auto;
    /* Allow horizontal scrolling */
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

/* Hide scrollbar Chrome/Safari */
.nav-container::-webkit-scrollbar {
    display: none;
}

.nav-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    /* Prevent text wrapping */
    flex-shrink: 0;
    /* Prevent shrinking */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-item i {
    font-size: 1.1rem;
}

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

.nav-item.active {
    color: var(--text-active-tab);
    border-bottom-color: var(--primary-color);
}

/* Mobile Navigation Tweaks */
@media (max-width: 600px) {
    .nav-bar {
        padding: 0 0.5rem;
        /* Less padding on container */
    }

    .nav-container {
        justify-content: space-between;
        /* Spread items out */
        overflow-x: visible;
        /* No scrolling needed if they fit */
    }

    .nav-item {
        padding: 0.75rem 0.25rem;
        /* Compact padding */
        flex-direction: column;
        /* Stack Icon + Text */
        gap: 0.25rem;
        flex: 1;
        /* Distribute space equally */
        text-align: center;
        border-bottom: 3px solid transparent;
        /* Thicker active line for visibility */
    }

    .nav-item i {
        font-size: 1.25rem;
        /* Larger icon */
        margin-bottom: 0;
    }

    .nav-item span {
        font-size: 0.7rem;
        /* Tiny text */
        line-height: 1;
    }

    .nav-item.active {
        background: rgba(37, 99, 235, 0.05);
        /* Subtle active background */
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    }
}

/* Layout Grid */
.layout-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    min-height: calc(100vh - var(--header-height) - 100px);
}

.main-content {
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: calc(var(--header-height) + 4rem);
    height: fit-content;
}

.ad-slot {
    background: var(--border-color);
    border-radius: var(--radius-md);
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.ad-placeholder-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

@media (max-width: 1024px) {
    .layout-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }
}

/* Tool Sections */
.tool-header {
    margin-bottom: 1.5rem;
}

.tool-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tool-desc {
    color: var(--text-muted);
}

/* Input Section */
.input-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

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

.toolbar h2 {
    font-size: 1.125rem;
    font-weight: 500;
}

.textarea-wrapper {
    position: relative;
    height: 60vh;
}

textarea {
    width: 100%;
    height: 100%;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-main);
    resize: none;
    outline: none;
}

textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* Form Controls */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text-main);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.range-control {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.range-control .btn {
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
}

.range-control input[type="range"] {
    flex: 1;
}

.checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-item input {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.result-display {
    background: var(--bg-body);
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.result-text {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    word-break: break-all;
    font-weight: 500;
    margin-bottom: 1rem;
    display: block;
}

/* Error Toast */
.error-toast {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn.primary {
    background: var(--primary-color);
    color: white;
}

.btn.primary:hover {
    background: var(--primary-hover);
}

.btn.primary:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.btn.secondary {
    background: var(--bg-body);
    border-color: var(--border-color);
    color: var(--text-main);
}

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

.btn.lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

margin-left: 4px;
}

/* --- Password Generator Specifics --- */
.password-tool-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.password-display-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.password-input-group {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    min-width: 300px;
}

.password-input-group input {
    width: 100%;
    padding: 1rem 1.5rem;
    padding-right: 140px;
    /* Space for badge + refresh */
    font-family: var(--font-mono);
    font-size: 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 99px;
    background: var(--bg-card);
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
}

.password-input-group input:focus {
    border-color: var(--primary-color);
}

.password-actions-internal {
    position: absolute;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.strength-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.strength-badge.Weak {
    background: #fee2e2;
    color: #dc2626;
}

.strength-badge.Medium {
    background: #ffedd5;
    color: #ea580c;
}

.strength-badge.Strong {
    background: #dcfce7;
    color: #16a34a;
}

.btn-refresh {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: var(--bg-body);
    color: var(--primary-color);
    transform: rotate(180deg);
}

.btn-copy-lg {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 99px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-copy-lg:hover {
    background: var(--primary-hover);
}

/* Controls */
.control-row {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.label-text {
    font-weight: 500;
    min-width: 150px;
    color: var(--text-main);
}

.length-control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    /* Take remaining space */
    width: 100%;
}

.btn-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-circle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--bg-active-tab);
}

.custom-range {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    /* Blue thumb */
    border: 2px solid var(--bg-card);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
    box-shadow: 0 0 0 1px var(--primary-color);
}

.custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.checkbox-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.checkbox-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}

.checkbox-pill input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.checkbox-pill input[type="checkbox"]:checked {
    background: var(--primary-color);
}

.checkbox-pill input[type="checkbox"]:checked::after {
    content: '✓';
    color: white;
    font-size: 0.875rem;
    font-weight: bold;
}

/* API Key Tool Specifics */
.api-result-box {
    background: #0f172a;
    /* Dark blue/black */
    border-radius: var(--radius-md);
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 3rem;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.api-key-display {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 2rem;
    word-break: break-all;
    min-height: 2.25rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2rem;
    /* Space for button */
}

.api-refresh-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.25rem;
    padding: 0.5rem;
    transition: all 0.2s;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.api-refresh-btn:hover {
    color: white;
    transform: translateY(-50%) rotate(180deg);
}

.btn-copy-blue {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-copy-blue:hover {
    background: var(--primary-hover);
}

@media (max-width: 600px) {
    .password-tool-container {
        padding: 1rem;
    }

    .tool-header h2 {
        font-size: 1.5rem;
    }

    .password-display-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .password-input-group {
        min-width: 0;
        /* Allow shrinking */
        width: 100%;
    }

    .password-input-group input {
        padding: 0.75rem 1rem;
        /* create space for internal actions */
        padding-right: 110px;
        font-size: 1rem;
        text-align: left;
    }

    .password-actions-internal {
        right: 0.5rem;
    }

    .strength-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    .btn-copy-lg {
        width: 100%;
        padding: 0.75rem;
    }

    .control-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .label-text {
        min-width: auto;
        margin-bottom: 0.5rem;
    }

    .length-control-group {
        width: 100%;
    }

    .checkbox-row {
        gap: 1rem;
        justify-content: space-between;
    }

    .checkbox-pill {
        font-size: 0.9rem;
    }

    /* API Tool Mobile */
    .api-result-box {
        padding: 1.5rem 1rem;
        margin-bottom: 2rem;
    }

    .api-key-display {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
        word-break: break-all;
    }

    .btn-copy-blue {
        width: 100%;
    }
}

.api-key-display {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    word-break: break-all;
}

.btn-copy-blue {
    width: 100%;
}
}

/* DevPulse News Feed */
.news-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

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

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.privacy-badge {
    background: #dcfce7;
    color: #166534;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

[data-theme="dark"] .privacy-badge {
    background: #064e3b;
    color: #a7f3d0;
}

.source-filters {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.filter-btn {
    background: none;
    border: none;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-btn:hover {
    color: var(--text-main);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* For image corners */
    color: var(--text-main);
    /* Force main text color, overriding <a> blue */
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-color: var(--primary-color);
}

.card-image-wrapper {
    height: 160px;
    width: 100%;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Make it fill remaining height */
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.source-badge {
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.source-badge.hn {
    background: #ff6600;
    color: white;
}

.source-badge.devto {
    background: #0a0a0a;
    color: white;
}

[data-theme="dark"] .source-badge.devto {
    background: #3b82f6;
}

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

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: var(--text-main);
    /* Ensure readability */
}

.news-card:hover .news-title {
    color: var(--primary-color);
}

.news-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    flex: 1;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

.card-footer i {
    margin-right: 4px;
}

/* Skeleton Loader */
.skeleton .skeleton-line {
    background: var(--border-color);
    border-radius: 4px;
    margin-bottom: 0.75rem;
    animation: pulse 1.5s infinite;
}

.skeleton .title {
    height: 1.5rem;
    width: 80%;
}

.skeleton .meta {
    height: 1rem;
    width: 40%;
}

.skeleton .desc {
    height: 3rem;
    width: 100%;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

.error-state {
    text-align: center;
    padding: 4rem;
    color: var(--text-muted);
}

.error-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* Global News Ticker */
.news-ticker {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    height: 36px;
    /* Slightly thinner */
    display: flex;
    align-items: center;
    overflow: hidden;
    position: sticky;
    /* Make it stick too */
    top: var(--header-height);
    /* Below the sticky header */
    z-index: 90;
    font-size: 0.85rem;
    white-space: nowrap;
}

.ticker-label {
    background: var(--primary-color);
    color: white;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 600;
    z-index: 10;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    font-size: 0.8rem;
}

.ticker-track {
    display: flex;
    align-items: center;
    /* Slide creates the space for the animation */
    /* animation: scroll 40s linear infinite; */
    /* Implementation note: track contains content which is duplicated. 
       We animate the inner content wrapper or just overflow? 
       Actually, standard endless ticker moves the track. */
    width: 100%;
    overflow: hidden;
}

.ticker-content {
    display: inline-flex;
    animation: scroll 120s linear infinite;
    /* Slowed down from 60s */
}

.ticker-content:hover {
    animation-play-state: paused;
}

.ticker-item {
    color: var(--text-main);
    text-decoration: none;
    margin-right: 3rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s;
}

.ticker-item:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.ticker-item::before {
    content: "•";
    color: var(--primary-color);
    font-weight: bold;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }

    /* We assume content is duplicated, so moving -50% (halfway) brings us back to start visually */
}

/* Editor Layout */
.json-tool-container {
    height: calc(100vh - var(--header-height) - 180px);
    /* Fill available space */
    display: flex;
    flex-direction: column;
}

.main-toolbar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Fullscreen Mode */
.json-tool-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    background: var(--bg-body);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.json-tool-container.fullscreen .main-toolbar {
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.json-tool-container.fullscreen .editor-container {
    flex: 1;
    border-radius: var(--radius-md);
    height: auto;
    /* Allow it to fill remaining space */
}


.left-actions,
.right-actions {
    display: flex;
    gap: 0.5rem;
}

.editor-container {
    display: flex;
    flex: 1;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: var(--bg-card);
    overflow: hidden;
}

.editor-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    position: relative;
    min-width: 0;
    /* Flex fix */
}

.editor-pane:last-child {
    border-right: none;
}

.pane-header {
    background: var(--bg-body);
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.code-editor {
    flex: 1;
    width: 100%;
    border: none;
    resize: none;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    background: var(--bg-card);
    color: var(--text-main);
    white-space: pre;
    outline: none;
}

.code-editor:focus {
    background: var(--bg-body);
    /* Subtle focus indication */
}

/* Mobile Stack */
@media (max-width: 768px) {
    .editor-container {
        flex-direction: column;
        height: auto;
    }

    .editor-pane {
        height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .json-tool-container {
        height: auto;
    }
}

/* Data Table */
.data-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.data-section .toolbar {
    padding: 1rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}

.stats .pill {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 99px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.back-link {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.875rem;
}

.back-link:hover {
    color: var(--primary-color);
}

.table-container {
    overflow-x: auto;
    max-height: 75vh;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: left;
}

th {
    background: var(--bg-body);
    position: sticky;
    top: 0;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    z-index: 10;
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-mono);
    white-space: nowrap;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
}

tr:hover td {
    background-color: rgba(0, 0, 0, 0.02);
}

td.cell-null {
    background-color: var(--bg-null);
    color: var(--text-null);
    font-style: italic;
}

td.cell-empty {
    background-color: var(--bg-empty);
    color: var(--text-empty);
}

/* Search Box */
.search-box input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text-main);
    font-size: 0.875rem;
    width: 200px;
}

.search-box input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    background: var(--bg-card);
}

.footer-links {
    margin-top: 0.5rem;
}

.footer-links a {
    color: var(--primary-color);
    margin: 0 0.5rem;
    text-decoration: none;
}

.footer-links a:hover {
    text-underline-offset: 4px;
    text-decoration: underline;
}

.strength-meter {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.strength-meter span.Strong {
    color: #16a34a;
}

.strength-meter span.Medium {
    color: #d97706;
}

.strength-meter span.Weak {
    color: #dc2626;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 99px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

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

.toast-notification.success {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.toast-notification.error {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #991b1b;
}

.toast-notification.info {
    border-color: var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
}

[data-theme="dark"] .toast-notification.success {
    background: #14532d;
    border-color: #166534;
    color: #dcfce7;
}

[data-theme="dark"] .toast-notification.error {
    background: #7f1d1d;
    border-color: #991b1b;
    color: #fee2e2;
}

/* Social Links */
.header-social-links,
.footer-social-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.header-social-links a,
.footer-social-links a {
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: color 0.2s;
}

.header-social-links a:hover,
.footer-social-links a:hover {
    color: var(--primary-color);
}

.header-social-links {
    margin-left: 1rem;
}

.footer-social-links {
    justify-content: center;
    margin-top: 1rem;
}

/* Responsive Header Tweaks */
@media (max-width: 768px) {

    .app-header,
    .layout-container,
    .nav-bar {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .header-social-links {
        display: none;
        /* Hide header social links on mobile to save space */
    }

    /* Adjust editor height for mobile */
    .editor-pane {
        width: 100%;
        flex: none;
        /* Vital: prevents collapsing to content size */
        height: 50vh;
        /* Explicit height */
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .editor-container {
        flex-direction: column;
        height: auto;
    }

    .json-tool-container {
        height: auto;
    }
}

@media (max-width: 480px) {

    .app-header,
    .layout-container,
    .nav-bar {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .main-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .toolbar h2 {
        display: none;
        /* Hide toolbar title on mobile if any */
    }

    .left-actions,
    .right-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: space-between;
    }

    /* Format Button - Full Width */
    .left-actions .btn:first-child {
        width: 100%;
        order: -1;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    /* Other buttons share space */
    .left-actions .btn:not(:first-child),
    .right-actions .btn {
        flex: 1;
        min-width: 0;
        /* Allow shrinking below content size if needed */
        justify-content: center;
    }

    /* Ensure icons don't break layout */
    .btn i {
        margin-right: 4px;
    }
}