/* Modern Security Data Explorer - Full Redesign */

/* Tailwind-inspired color palette */
:root {
    /* Slate neutrals */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --slate-950: #020617;

    /* Accent colors */
    --indigo-400: #818cf8;
    --indigo-500: #6366f1;
    --indigo-600: #4f46e5;
    --violet-400: #a78bfa;
    --violet-500: #8b5cf6;

    /* Gemini gradient colors */
    --gemini-blue: #4285f4;
    --gemini-cyan: #00bcd4;
    --gemini-purple: #ab47bc;
    --gemini-pink: #e91e63;
    --gemini-gradient: linear-gradient(135deg, #4285f4, #9b72cb);
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --rose-400: #fb7185;
    --rose-500: #f43f5e;
    --sky-400: #38bdf8;
    --sky-500: #0ea5e9;

    /* Semantic colors - Dark mode default */
    --bg-primary: var(--slate-950);
    --bg-secondary: var(--slate-900);
    --bg-tertiary: var(--slate-800);
    --bg-hover: var(--slate-700);
    --text-primary: var(--slate-100);
    --text-secondary: var(--slate-400);
    --text-muted: var(--slate-500);
    --border-color: var(--slate-700);
    --border-subtle: var(--slate-800);
    --accent: var(--indigo-500);
    --accent-hover: var(--indigo-400);
    --accent-gradient: linear-gradient(135deg, var(--indigo-500), var(--violet-500));
    --success: var(--emerald-500);
    --error: var(--rose-500);
    --warning: var(--amber-500);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    --shadow-glow: 0 0 20px rgb(99 102 241 / 0.3);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

/* Light mode */
[data-theme="light"] {
    --bg-primary: var(--slate-50);
    --bg-secondary: white;
    --bg-tertiary: var(--slate-100);
    --bg-hover: var(--slate-200);
    --text-primary: var(--slate-900);
    --text-secondary: var(--slate-600);
    --text-muted: var(--slate-400);
    --border-color: var(--slate-200);
    --border-subtle: var(--slate-100);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgb(99 102 241 / 0.2);
}

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

/* Base */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    margin-bottom: 20px;
}

.header-spacer {
    flex: 1;
}

#theme-toggle,
#settings-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

#theme-toggle:hover,
#settings-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Logo */
.logo-container {
    text-align: center;
    margin: 60px 0 40px;
}

.logo {
    font-size: 2.75rem;
    font-weight: 700;
    background: var(--gemini-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    display: inline-block;
}


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

.confidential {
    color: var(--rose-400);
    font-size: 0.8rem;
    margin-top: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Search Section */
.search-section {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

.search-controls {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    overflow: hidden;
}

.search-controls:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

/* Entity Select */
#entity-type {
    background: var(--bg-tertiary);
    border: none;
    border-right: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 16px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    min-width: 160px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
    transition: all 0.2s ease;
}

#entity-type:hover {
    background-color: var(--bg-hover);
}

#entity-type:focus {
    outline: none;
    color: var(--text-primary);
}

/* Search Input */
.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 8px;
}

#search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    padding: 16px 12px;
    outline: none;
}

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

/* Logging Toggle */
.logging-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border-left: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.logging-toggle input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    cursor: pointer;
    margin: 0;
}

.logging-toggle span {
    transition: color 0.2s ease;
}

.logging-toggle:hover span {
    color: var(--text-primary);
}

/* Search Button */
#search-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 12px 28px;
    margin: 6px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

#search-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

#search-btn:active {
    transform: translateY(0);
}

#search-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Recent Queries */
.recent-queries {
    margin-top: 24px;
    padding: 0 8px;
}

.recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.recent-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.clear-history-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.clear-history-btn:hover {
    color: var(--rose-400);
    background: var(--bg-tertiary);
}

.recent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 140px;
    overflow-y: auto;
}

.query-chip {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.query-chip:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.query-chip .icon {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Results Section */
#results-container {
    margin-top: 40px;
    flex: 1;
}

.placeholder-text {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px;
    font-size: 0.95rem;
}

/* Getting Started Section */
.getting-started {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.getting-started h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-align: center;
}

.getting-started-intro {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.code-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    justify-content: center;
}

.code-select-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.code-select-group select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 36px 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.2s ease;
    min-width: 140px;
}

.code-select-group select:hover {
    border-color: var(--accent);
}

.code-select-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.2);
}

.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.code-lang {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.code-copy-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.code-copy-btn.copied {
    background: var(--emerald-500);
    color: white;
    border-color: var(--emerald-500);
}

.code-block pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
}

.code-block code {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-primary);
    display: block;
}

/* Syntax highlighting */
.code-keyword {
    color: var(--violet-400);
    font-weight: 500;
}

.code-string {
    color: var(--emerald-400);
}

.code-comment {
    color: var(--slate-500);
    font-style: italic;
}

.code-function {
    color: var(--sky-400);
}

.code-property {
    color: var(--rose-400);
}

.code-number {
    color: var(--amber-400);
}

/* Light mode syntax colors */
[data-theme="light"] .code-keyword {
    color: var(--violet-500);
}

[data-theme="light"] .code-string {
    color: #059669;
}

[data-theme="light"] .code-function {
    color: #0284c7;
}

[data-theme="light"] .code-property {
    color: #e11d48;
}

[data-theme="light"] .code-number {
    color: #d97706;
}

/* Result Header */
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.result-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.result-title h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.result-badge {
    background: var(--accent-gradient);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-actions {
    display: flex;
    gap: 8px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

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

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

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

.btn-primary:hover {
    opacity: 0.9;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
}

/* Feedback Box */
.feedback-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.feedback-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.feedback-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.feedback-buttons {
    display: flex;
    gap: 8px;
}

.feedback-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.feedback-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.feedback-btn.thumb-up.selected {
    background: var(--emerald-500);
    border-color: var(--emerald-500);
    color: white;
}

.feedback-btn.thumb-down.selected {
    background: var(--rose-500);
    border-color: var(--rose-500);
    color: white;
}

.feedback-input-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.feedback-input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.feedback-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.2);
}

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

.feedback-submit {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-submit:hover:not(:disabled) {
    opacity: 0.9;
}

.feedback-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feedback-disclaimer {
    margin-top: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

.feedback-status {
    margin-top: 12px;
    font-size: 0.85rem;
    text-align: center;
}

.feedback-status.success {
    color: var(--emerald-400);
}

.feedback-status.error {
    color: var(--rose-400);
}

/* Result Card */
.result-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.result-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.result-card-badge {
    background: var(--accent);
    color: white;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.result-card-actions {
    display: flex;
    gap: 8px;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.copy-btn.copied {
    background: var(--emerald-500);
    color: white;
    border-color: var(--emerald-500);
}

.copy-btn svg {
    width: 14px;
    height: 14px;
}

.result-card-body {
    padding: 20px;
    max-height: 600px;
    overflow: auto;
}

/* JSON Viewer */
.json-viewer {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.7;
}

.json-item {
    position: relative;
}

.json-line {
    display: flex;
    align-items: flex-start;
    padding: 2px 8px 2px 28px;
    border-radius: var(--radius-sm);
    position: relative;
    min-height: 28px;
}

.json-line:hover {
    background: var(--bg-tertiary);
}

.json-line:hover .json-copy-btn {
    opacity: 1;
}

.json-children {
    margin-left: 20px;
    padding-left: 12px;
    border-left: 1px solid var(--border-subtle);
}

.json-toggle {
    position: absolute;
    left: 8px;
    top: 6px;
    cursor: pointer;
    user-select: none;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.65rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.json-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.json-toggle-spacer {
    width: 16px;
    display: inline-block;
}

.json-copy-btn {
    position: absolute;
    right: 8px;
    top: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

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

.json-copy-btn.copied {
    opacity: 1;
    background: var(--emerald-500);
    color: white;
    border-color: var(--emerald-500);
}

/* JSON Syntax Colors - Dark mode optimized */
.json-key {
    color: var(--sky-400);
    font-weight: 500;
}

.json-value {
    margin-left: 4px;
}

.json-type-string {
    color: var(--emerald-400);
}

.json-type-number {
    color: var(--amber-400);
}

.json-type-boolean {
    color: var(--violet-400);
}

.json-type-null {
    color: var(--slate-500);
    font-style: italic;
}

.json-bracket {
    color: var(--text-muted);
    font-weight: 600;
}

.json-type-info {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-right: 6px;
    font-style: normal;
    opacity: 0.7;
}

.json-preview {
    display: none;
    color: var(--text-muted);
    margin-left: 4px;
    font-style: italic;
}

.json-item.collapsed .json-children,
.json-item.collapsed .json-close-bracket-line {
    display: none;
}

.json-item.collapsed .json-preview {
    display: inline;
}

.json-close-bracket-line {
    padding-left: 28px;
}

/* Light mode JSON colors */
[data-theme="light"] .json-key {
    color: var(--indigo-600);
}

[data-theme="light"] .json-type-string {
    color: #059669;
}

[data-theme="light"] .json-type-number {
    color: #d97706;
}

[data-theme="light"] .json-type-boolean {
    color: var(--violet-500);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.modal-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.modal-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.2);
}

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

.modal-footer {
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

#save-api-key {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#save-api-key:hover {
    opacity: 0.9;
}

/* Status Messages */
#status-msg {
    margin-top: 20px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-msg {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid var(--rose-500);
    color: var(--rose-400);
}

.success-msg {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--emerald-500);
    color: var(--emerald-400);
}

/* Loading Spinner */
.loading-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

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

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--slate-600);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-500);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
    .app-container {
        padding: 16px;
    }

    .logo {
        font-size: 2rem;
    }

    .logo-container {
        margin: 40px 0 30px;
    }

    .search-controls {
        flex-direction: column;
        border-radius: var(--radius-md);
    }

    #entity-type {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        border-radius: var(--radius-md) var(--radius-md) 0 0;
        padding: 14px 16px;
    }

    .input-wrapper {
        padding: 4px;
    }

    #search-input {
        padding: 12px;
    }

    #search-btn {
        margin: 4px;
        padding: 12px 20px;
    }

    .logging-toggle {
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding: 12px 16px;
        justify-content: center;
    }

    .feedback-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .feedback-buttons {
        width: 100%;
        justify-content: flex-start;
    }

    .feedback-input-row {
        flex-direction: column;
    }

    .result-card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .result-card-actions {
        width: 100%;
    }

    .copy-btn {
        flex: 1;
        justify-content: center;
    }
}

/* Inter font import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');
