/* Cluster22 - Main Styles */

:root {
    --bg-dark: #0a0a0b;
    --bg-card: #141416;
    --bg-card-hover: #1a1a1d;
    --bg-input: #1c1c1f;
    --border: #2a2a2d;
    --border-light: #3a3a3d;
    --text: #ffffff;
    --text-muted: #71717a;
    --text-dim: #52525b;
    --accent: #22d3ee;
    --accent-dim: #0e7490;
    --accent-glow: rgba(34, 211, 238, 0.3);
    --success: #4ade80;
    --success-dim: #166534;
    --warning: #fbbf24;
    --error: #f87171;
    --purple: #a78bfa;
    --pink: #f472b6;
}

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

body {
    font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Grid Background */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(34, 211, 238, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 211, 238, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.grid-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 0%, rgba(34, 211, 238, 0.08) 0%, transparent 50%);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: linear-gradient(to bottom, var(--bg-dark) 50%, transparent 100%);
}

.logo {
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--bg-dark);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.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(--accent);
}

/* Main Content */
main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    max-width: 800px;
    animation: fadeIn 0.8s ease-out;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    margin-bottom: 2rem;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 50%, var(--pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 3rem;
    line-height: 1.7;
}

/* Search Form */
.search-form {
    margin-bottom: 3rem;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.5rem;
    transition: all 0.3s ease;
    max-width: 600px;
    margin: 0 auto;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-icon {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    margin-left: 1rem;
    flex-shrink: 0;
}

.input-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 1rem;
    padding: 1rem;
    font-family: inherit;
}

.input-wrapper input::placeholder {
    color: var(--text-dim);
}

.input-wrapper button {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    color: var(--bg-dark);
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.input-wrapper button:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-arrow {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.input-wrapper button:hover .btn-arrow {
    transform: translateX(3px);
}

/* Features */
.features {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.feature-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
}

/* Loading State */
.loading-state {
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.loading-content {
    max-width: 400px;
}

.loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 2rem;
}

.loader-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.loader-ring:nth-child(2) {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-top-color: var(--purple);
    animation-duration: 2s;
    animation-direction: reverse;
}

.loader-ring:nth-child(3) {
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    border-top-color: var(--pink);
    animation-duration: 1s;
}

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

.loading-state h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.loading-state p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent);
}

/* Error State */
.error-state {
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.error-content {
    max-width: 400px;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-state h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.error-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    padding: 1.5rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.8rem;
    background: linear-gradient(to top, var(--bg-dark) 50%, transparent 100%);
    z-index: 10;
}

/* ============================================================================
   RESULTS PAGE STYLES
   ============================================================================ */

.results-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
}

.results-header {
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.results-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.results-keyword {
    color: var(--accent);
    font-family: 'Space Mono', monospace;
}

.results-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    animation: fadeIn 0.5s ease-out 0.1s both;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.tabs::-webkit-scrollbar {
    height: 6px;
}

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

.tabs::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

/* New Tab Item Style */
.tab-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
    max-width: 220px;
    flex-shrink: 0;
}

.tab-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
}

.tab-item.active {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(34, 211, 238, 0.05));
    border-color: var(--accent);
    min-width: 320px;
    max-width: 400px;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.2);
}

.tab-item.active .tab-title {
    white-space: normal;
    overflow: visible;
}

.tab-item.active .tab-kw {
    white-space: normal;
    max-width: none;
    overflow: visible;
}

.tab-item.active .tab-keywords {
    max-height: none;
}

.tab-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tab-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.pillar-badge {
    background: var(--accent);
    color: var(--bg-dark);
}

.cluster-badge {
    background: var(--purple);
    color: var(--bg-dark);
}

.tab-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.tab-kw {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.tab-item.active .tab-kw {
    background: rgba(34, 211, 238, 0.2);
    color: var(--accent);
}

/* Old tab styles (keep for backward compatibility) */
.tab {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-dark);
}

.tab-pillar {
    background: linear-gradient(135deg, var(--accent-dim), var(--accent));
    border-color: var(--accent);
    color: var(--bg-dark);
}

/* Slide Panel */
.slide-panel {
    position: fixed;
    top: 0;
    right: -520px;
    width: 520px;
    max-width: 90vw;
    height: 100vh;
    background: #0a0d12;
    border-left: 2px solid var(--accent);
    z-index: 1000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.8);
}

.slide-panel.open {
    right: 0;
}

.slide-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.slide-panel-overlay.open {
    opacity: 1;
    visibility: visible;
}

.slide-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--accent-dim);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.1), transparent);
}

.slide-panel-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
}

.slide-panel-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: color 0.2s;
    border-radius: 4px;
}

.slide-panel-close:hover {
    color: var(--accent);
    background: rgba(34, 211, 238, 0.1);
}

.slide-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    background: #0a0d12;
}

/* Competitor Items in Panel */
.competitor-item {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: #12161f;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid rgba(34, 211, 238, 0.15);
    transition: all 0.2s ease;
}

.competitor-item:hover {
    border-color: var(--accent);
    background: #161b26;
}

.competitor-rank {
    font-family: 'Space Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--bg-dark);
    background: var(--accent);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    height: fit-content;
    flex-shrink: 0;
    min-width: 32px;
    text-align: center;
}

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

.competitor-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.6rem;
    line-height: 1.4;
}

.competitor-meta {
    font-size: 0.9rem;
    color: #a0aec0;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.competitor-url {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.competitor-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: #718096;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.competitor-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* View Competitors Button */
.view-competitors-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.view-competitors-btn:hover {
    background: var(--bg-card-hover);
    color: var(--accent);
    border-color: var(--accent-dim);
}

.card-actions {
    display: flex;
    gap: 0.5rem;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

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

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    animation: fadeIn 0.5s ease-out;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-title-icon {
    width: 20px;
    height: 20px;
    color: var(--accent);
    flex-shrink: 0;
}

.copy-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text);
    border-color: var(--border-light);
}

.copy-btn.copied {
    background: var(--success-dim);
    border-color: var(--success);
    color: var(--success);
}

.card-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Inject Content Button */
.inject-btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    border: none;
    color: var(--bg-dark);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.inject-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.inject-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.inject-btn.loading {
    background: var(--bg-input);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.inject-btn.loading .inject-btn-text::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    border: 2px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.inject-btn.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.inject-btn.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.prompted-inject-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
}

.prompted-inject-btn:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
}

/* Inject Progress Bar */
.inject-progress {
    background: rgba(34, 211, 238, 0.05);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.inject-progress-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.progress-status {
    color: var(--accent);
    font-weight: 500;
}

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

.inject-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.inject-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--purple) 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.inject-progress-hint {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    text-align: center;
}

/* Injected Content Styles */
.heading-tree.with-content .heading-item {
    border-bottom: none;
    padding-bottom: 0.25rem;
}

.injected-content {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--accent-dim);
    margin: 0.5rem 0 1.5rem 2.5rem;
    padding: 1rem 1.25rem;
    border-radius: 0 8px 8px 0;
    font-family: 'Instrument Sans', sans-serif;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #cbd5e1;
}

.injected-content p {
    margin: 0 0 0.75rem 0;
}

.injected-content p:last-child {
    margin-bottom: 0;
}

/* Keyword Highlighting */
.keyword-highlight {
    background: rgba(34, 211, 238, 0.15);
    color: var(--accent);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 500;
}

.internal-link-highlight {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-weight: 500;
    border-bottom: 1px dashed #8b5cf6;
    cursor: pointer;
    position: relative;
}

.internal-link-highlight:hover::after {
    content: attr(data-target);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e1b4b;
    color: #a78bfa;
    font-size: 0.75rem;
    font-family: 'Space Mono', monospace;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    border: 1px solid #4c1d95;
    z-index: 100;
    pointer-events: none;
}

/* Content Stats */
.content-stats {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-words {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-keywords {
    font-size: 0.75rem;
    color: var(--accent);
}

/* Content Summary */
.content-summary {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    background: rgba(34, 211, 238, 0.05);
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: 10px;
}

.summary-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

/* Content Footer with AI Edit */
.content-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-edit-btn {
    background: transparent;
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: var(--purple);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

.ai-edit-btn:hover {
    background: rgba(167, 139, 250, 0.1);
    border-color: var(--purple);
}

.ai-edit-btn svg {
    opacity: 0.8;
}

/* Content Updated Flash Animation */
.content-updated {
    animation: contentFlash 1.5s ease;
}

@keyframes contentFlash {
    0% { background: rgba(34, 211, 238, 0.1); }
    100% { background: rgba(255, 255, 255, 0.03); }
}

/* AI Edit Modal */
.ai-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.ai-edit-modal.open {
    opacity: 1;
    visibility: visible;
}

.ai-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.ai-edit-panel {
    position: relative;
    background: #13161d;
    border: 1px solid var(--purple);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(167, 139, 250, 0.2);
}

.ai-edit-modal.open .ai-edit-panel {
    transform: translateY(0);
}

.ai-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(167, 139, 250, 0.15);
}

.ai-edit-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #c4b5fd;
}

.ai-edit-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.ai-edit-close:hover {
    color: var(--text);
}

.ai-edit-body {
    padding: 1.5rem;
}

.ai-edit-current {
    margin-bottom: 1.25rem;
}

.ai-edit-current label,
.ai-edit-input label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.ai-edit-current-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.direct-edit-btn {
    background: transparent;
    border: 1px solid rgba(34, 211, 238, 0.3);
    color: var(--accent);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.direct-edit-btn:hover {
    background: rgba(34, 211, 238, 0.1);
    border-color: var(--accent);
}

.direct-edit-btn.active {
    background: var(--accent);
    color: #0a0d12;
    border-color: var(--accent);
}

.ai-edit-current-text {
    background: #1a1d26;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #f1f5f9;
    max-height: 180px;
    overflow-y: auto;
}

.ai-edit-current-text.editable {
    border-color: var(--accent);
    background: #1e2230;
    outline: none;
    cursor: text;
}

.ai-edit-current-text.editable:focus {
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
}

.ai-edit-input {
    margin-bottom: 1.25rem;
}

.ai-edit-input label {
    color: #e2e8f0;
}

.ai-edit-input textarea {
    width: 100%;
    background: #1a1d26;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #f1f5f9;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s;
}

.ai-edit-input textarea:focus {
    outline: none;
    border-color: var(--purple);
}

.ai-edit-input textarea::placeholder {
    color: #64748b;
    font-size: 0.85rem;
}

.ai-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.ai-edit-cancel {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.ai-edit-cancel:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.ai-edit-submit {
    background: linear-gradient(135deg, var(--purple) 0%, #8b5cf6 100%);
    border: none;
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.ai-edit-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(167, 139, 250, 0.3);
}

.ai-edit-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.ai-edit-submit .spin {
    animation: spin 1s linear infinite;
}

/* Direct edit mode actions */
.direct-edit-actions {
    display: none;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.direct-edit-actions.visible {
    display: flex;
}

.direct-edit-done {
    background: linear-gradient(135deg, var(--accent) 0%, #06b6d4 100%);
    border: none;
    color: #0a0d12;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.direct-edit-done:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 211, 238, 0.3);
}

/* Hide AI input section during direct edit */
.ai-edit-body.direct-editing .ai-edit-input,
.ai-edit-body.direct-editing .ai-edit-actions {
    display: none;
}

.card-body {
    padding: 1.5rem;
}

/* SEO Metadata Card */
.seo-field {
    margin-bottom: 1.5rem;
}

.seo-field:last-child {
    margin-bottom: 0;
}

.seo-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.char-count {
    font-weight: 400;
    color: var(--text-dim);
}

.seo-value {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
}

.seo-value.slug {
    font-family: 'Space Mono', monospace;
    color: var(--accent);
}

input.seo-editable {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

input.seo-editable:focus {
    border-color: var(--accent);
}

input.seo-editable.slug {
    font-family: 'Space Mono', monospace;
    color: var(--accent);
}


.seo-slug-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.seo-slug-row .slug-display {
    flex: 1;
    font-family: 'Space Mono', monospace;
    color: var(--accent);
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    word-break: break-all;
}

.slug-edit-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s;
    flex-shrink: 0;
}

.slug-edit-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
/* Heading Structure Card */
.heading-tree {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    line-height: 2;
}

.heading-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.heading-item:last-child {
    border-bottom: none;
}

.heading-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.heading-tag.h1 {
    background: var(--accent);
    color: var(--bg-dark);
}

.heading-tag.h2 {
    background: var(--purple);
    color: var(--bg-dark);
}

.heading-tag.h3 {
    background: var(--pink);
    color: var(--bg-dark);
    margin-left: 1.5rem;
}

.heading-text {
    flex: 1;
    color: var(--text);
    font-family: 'Instrument Sans', sans-serif;
}

.heading-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: 'Instrument Sans', sans-serif;
}

/* Keyword Hints in Heading Structure */
.heading-keywords-hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
}

.keywords-count {
    font-size: 0.7rem;
    color: var(--accent);
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Instrument Sans', sans-serif;
    white-space: nowrap;
}

.keywords-count:hover {
    background: rgba(34, 211, 238, 0.2);
    border-color: var(--accent);
}

.keywords-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: #0a0d12;
    border: 1px solid var(--accent);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    min-width: 200px;
    max-width: 260px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.heading-keywords-hint:hover .keywords-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.tooltip-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-family: 'Instrument Sans', sans-serif;
}

.tooltip-keyword {
    font-size: 0.8rem;
    color: #e2e8f0;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-family: 'Instrument Sans', sans-serif;
}

.tooltip-keyword:last-child {
    border-bottom: none;
}

/* Keywords Card */
.keyword-section {
    margin-bottom: 1.5rem;
}

.keyword-section:last-child {
    margin-bottom: 0;
}

.keyword-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.85rem;
}

.keyword-primary {
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.keyword-primary-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.75rem;
}

.keyword-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.keyword-stat {
    font-size: 0.8rem;
}

.keyword-stat-label {
    color: #a0aec0;
}

.keyword-stat-value {
    color: #fff;
    font-weight: 500;
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.keyword-tag {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #cbd5e1;
    transition: all 0.2s ease;
}

.keyword-tag:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(34, 211, 238, 0.4);
    color: #fff;
}

/* Links Card */
.link-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.link-item:last-child {
    border-bottom: none;
}

.link-anchor {
    color: var(--text);
    flex: 1;
}

.link-arrow {
    color: var(--text-dim);
}

.link-target {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent);
}

/* Gaps Card */
.gap-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: 10px;
    margin-bottom: 0.75rem;
}

.gap-item:last-child {
    margin-bottom: 0;
}

.gap-score {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.gap-score.high {
    background: var(--success-dim);
    color: var(--success);
}

.gap-score.medium {
    background: rgba(251, 191, 36, 0.2);
    color: var(--warning);
}

.gap-score.low {
    background: var(--bg-card);
    color: var(--text-muted);
}

.gap-content {
    flex: 1;
}

.gap-topic {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.gap-recommendation {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.gap-coverage {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

/* Benchmarks Card */
.benchmark-table {
    width: 100%;
    border-collapse: collapse;
}

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

.benchmark-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.benchmark-table td {
    font-size: 0.9rem;
}

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

.benchmark-target {
    color: var(--accent);
    font-weight: 600;
}

.benchmark-current {
    color: var(--text-muted);
    font-weight: 500;
}

.benchmark-current.has-value {
    color: var(--purple);
    font-weight: 600;
}

/* Keyword Usage Count */
.keyword-usage-count {
    font-size: 0.75em;
    color: var(--text-dim);
    font-weight: 400;
    margin-left: 0.25rem;
}

.keyword-usage-count.has-usage {
    color: var(--success);
    font-weight: 600;
}

.keyword-primary-value .keyword-usage-count {
    font-size: 0.65em;
}

.keyword-tag .keyword-usage-count {
    opacity: 0.8;
}

/* Schema Tags */
.schema-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* FAQ Styles */
.faq-empty-state {
    text-align: center;
    padding: 2rem 1rem;
}

.faq-empty-state p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.crawl-faq-btn {
    background: linear-gradient(135deg, var(--accent) 0%, #06b6d4 100%);
    border: none;
    color: #0a0d12;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.crawl-faq-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 211, 238, 0.3);
}

.crawl-faq-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.crawl-faq-btn .spin {
    animation: spin 1s linear infinite;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    transition: border-color 0.2s;
}

.faq-item:hover {
    border-color: rgba(34, 211, 238, 0.3);
}

.faq-question {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.faq-question-text {
    flex: 1;
    min-width: 0;
}

.faq-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.faq-item:hover .faq-item-actions {
    opacity: 1;
}

.faq-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
}

.faq-delete-btn:hover {
    color: var(--error, #ef4444);
    background: rgba(239, 68, 68, 0.1);
}

.faq-number {
    background: var(--accent);
    color: #0a0d12;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.faq-answer {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.7;
    padding-left: 2.5rem;
}

/* FAQ Schema Section */
.faq-schema-section {
    margin-top: 1.5rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.faq-schema-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    transition: all 0.2s;
}

.faq-schema-toggle:hover {
    border-color: var(--accent);
    color: var(--text);
}

.faq-schema-toggle .chevron {
    margin-left: auto;
    transition: transform 0.2s;
}

.faq-schema-content {
    display: none;
    margin-top: 1rem;
}

.faq-schema-content.open {
    display: block;
}

.faq-schema-content.open + .faq-schema-toggle .chevron,
.faq-schema-toggle:has(+ .faq-schema-content.open) .chevron {
    transform: rotate(180deg);
}

.faq-schema-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.faq-schema-header span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.copy-schema-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}

.copy-schema-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.faq-schema-code {
    background: #0a0d12;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #a5f3fc;
    overflow-x: auto;
    white-space: pre;
    max-height: 300px;
    overflow-y: auto;
}

.schema-tag {
    background: var(--bg-input);
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.schema-tag.recommended {
    border-color: var(--success-dim);
    color: var(--success);
}

.schema-check {
    color: var(--success);
}

/* Website Settings Modal */
.website-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.website-settings-modal.open {
    opacity: 1;
    visibility: visible;
}

.website-settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.website-settings-panel {
    position: relative;
    background: #0f1219;
    border: 1px solid var(--accent);
    border-radius: 16px;
    width: 95%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.website-settings-modal.open .website-settings-panel {
    transform: translateY(0);
}

.website-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: rgba(34, 211, 238, 0.05);
}

.website-settings-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
}

.website-settings-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.website-settings-close:hover {
    color: var(--text);
}

.website-settings-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.settings-section {
    margin-bottom: 2rem;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.settings-field.full-width {
    grid-column: span 2;
}

.settings-field label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.settings-field input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    color: var(--text);
    font-family: inherit;
    transition: border-color 0.2s;
}

.settings-field input:focus {
    outline: none;
    border-color: var(--accent);
}

.settings-field input::placeholder {
    color: var(--text-dim);
}

/* Theme Selector */
.theme-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.theme-option {
    cursor: pointer;
}

.theme-option input {
    display: none;
}

.theme-preview {
    background: var(--bg-input);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem;
    transition: all 0.2s;
    text-align: center;
}

.theme-option input:checked + .theme-preview {
    border-color: var(--accent);
    background: rgba(34, 211, 238, 0.1);
}

.theme-preview:hover {
    border-color: rgba(34, 211, 238, 0.5);
}

.theme-name {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.theme-colors {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

.theme-colors span {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Export Pages List */
.export-pages-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.export-page-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.export-page-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.export-page-item label {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text);
    cursor: pointer;
}

.export-page-item .page-type {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.export-page-item .page-type.pillar {
    background: rgba(34, 211, 238, 0.2);
    color: var(--accent);
}

.export-page-item .page-type.cluster {
    background: rgba(167, 139, 250, 0.2);
    color: var(--purple);
}

.export-page-item .page-type.home {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

/* Settings Actions */
.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    margin-top: 1.5rem;
}

.settings-cancel {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.settings-cancel:hover {
    border-color: var(--text-muted);
    color: var(--text);
}

.settings-export {
    background: linear-gradient(135deg, var(--accent) 0%, #06b6d4 100%);
    border: none;
    color: #0a0d12;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.settings-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 211, 238, 0.3);
}

.settings-export:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.settings-export .spin {
    animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        padding: 1rem 1.5rem;
    }

    .nav-links {
        display: none;
    }

    h1 {
        font-size: 2.5rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .features {
        gap: 1rem;
    }

    .feature {
        font-size: 0.8rem;
    }

    .input-wrapper {
        flex-direction: column;
        padding: 1rem;
    }

    .input-wrapper input {
        width: 100%;
        text-align: center;
    }

    .input-wrapper button {
        width: 100%;
        justify-content: center;
    }

    .search-icon {
        display: none;
    }

    .tabs {
        gap: 0.25rem;
    }

    .tab {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    .card-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .results-header h1 {
        font-size: 1.8rem;
    }
}

/* ============================================================================
   Auth & User Menu
   ============================================================================ */

#auth-container {
    display: flex;
    align-items: center;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-login:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.user-menu:hover {
    background: var(--bg-card);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.user-dropdown a:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.user-dropdown a:first-child {
    border-radius: 8px 8px 0 0;
}

.user-dropdown a:last-child {
    border-radius: 0 0 8px 8px;
    border-top: 1px solid var(--border);
    color: var(--error);
}

/* ============================================================================
   Project Info & Save Button
   ============================================================================ */

.project-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.project-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.project-name svg {
    color: var(--accent);
}

.save-project-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--accent-dim);
    border: none;
    border-radius: 6px;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
}

.save-project-btn:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

.save-project-btn.has-changes {
    background: var(--warning);
    color: var(--bg-dark);
    animation: pulse-save 2s infinite;
}

@keyframes pulse-save {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.save-project-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ============================================================================
   Save Indicator Toast
   ============================================================================ */

.save-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
    pointer-events: none;
}

.save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.save-indicator.success {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid var(--success);
}

.save-indicator.error {
    background: rgba(248, 113, 113, 0.1);
    color: var(--error);
    border: 1px solid var(--error);
}

/* ============================================================================
   Create Project Modal
   ============================================================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.3s ease;
}

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

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
}

.modal-body .form-group {
    margin-bottom: 1rem;
}

.modal-body .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.modal-body .form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.modal-body .form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-hint {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
}

.btn-secondary {
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: var(--bg-dark);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--accent-dim);
    color: var(--text);
}

/* ============================================================================
   Dashboard / Projects List
   ============================================================================ */

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem 4rem;
    min-height: 100vh;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.dashboard-header .btn-primary {
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
}

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

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.project-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.project-card-keyword {
    font-size: 0.85rem;
    color: var(--accent);
}

.project-card-status {
    padding: 0.25rem 0.75rem;
    background: var(--accent-dim);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
}

.project-card-status.draft {
    background: var(--bg-card-hover);
    color: var(--text-muted);
}

.project-card-status.complete {
    background: var(--success-dim);
    color: var(--success);
}

.project-card-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.project-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

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

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.empty-state p {
    margin-bottom: 1.5rem;
}
