* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

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

header {
    background-color: #2196F3;
    color: white;
    padding: 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 20px;
}

.source-link {
    margin-bottom: 16px;
    padding: 8px;
}

.source-link a {
    color: #2196F3;
    text-decoration: underline;
    cursor: pointer;
}

.card {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    margin-bottom: 8px;
    padding: 16px;
}

.control-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

select,
input {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
}

select {
    flex: 1;
}

input {
    flex: 2;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

button svg {
    fill: #555;
}

.category-card {
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    margin-bottom: 8px;
    overflow: hidden;
}

.category-header {
    padding: 16px;
    background-color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    color: #555;
    font-size: 18px;
    user-select: none;
}

.category-header:hover {
    background-color: #fafafa;
}

.toggle-icon {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.toggle-icon svg {
    fill: currentColor;
}

.category-content {
    padding: 10px 20px 20px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid #eee;
}

.keyword-chip {
    display: inline-flex;
    align-items: center;
    background-color: #e0e0e0;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.keyword-chip:hover {
    background-color: #d5d5d5;
}

.keyword-chip.selected {
    background-color: #bbdefb;
    color: #0d47a1;
}

.keyword-chip .remove-btn {
    margin-left: 8px;
    font-size: 16px;
    line-height: 1;
    color: #757575;
    cursor: pointer;
}

.keyword-chip .remove-btn:hover {
    color: #d32f2f;
}

.hidden {
    display: none;
}

#loading-indicator {
    text-align: center;
    padding: 20px;
    color: #666;
}

#error-message {
    color: #d32f2f;
    padding: 16px;
    text-align: center;
    font-weight: bold;
}

.raw-json-section {
    margin-top: 24px;
    background-color: #eceff1;
    padding: 16px;
    border-radius: 4px;
}

pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 12px;
    color: #333;
}

#toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #323232;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

#toast.show {
    opacity: 1;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode header {
    background-color: #1f1f1f;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

body.dark-mode .card,
body.dark-mode .category-card,
body.dark-mode .category-header {
    background-color: #1e1e1e;
    color: #e0e0e0;
}

body.dark-mode .category-header:hover {
    background-color: #2c2c2c;
}

body.dark-mode .category-content {
    border-top-color: #333;
}

body.dark-mode select,
body.dark-mode input {
    background-color: #2c2c2c;
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode button svg {
    fill: #e0e0e0;
}

body.dark-mode .keyword-chip {
    background-color: #333;
    color: #e0e0e0;
}

body.dark-mode .keyword-chip:hover {
    background-color: #444;
}

body.dark-mode .keyword-chip.selected {
    background-color: #1565c0;
    color: #fff;
}

body.dark-mode .raw-json-section {
    background-color: #1e1e1e;
}

body.dark-mode pre {
    color: #bbb;
}

body.dark-mode .source-link a {
    color: #64b5f6;
}