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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #ff6600;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.error {
    color: #d32f2f;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Main App */
header {
    background: #ff6600;
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.3rem;
}

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

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    background: #888;
}

.status-dot.active { background: #4caf50; }
.status-dot.idle { background: #888; }
.status-dot.error { background: #d32f2f; }

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

section {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

section h2 {
    margin-bottom: 1rem;
    color: #555;
    font-size: 1.1rem;
}

/* Forms */
button {
    padding: 0.5rem 1rem;
    background: #ff6600;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

button:hover { background: #e55d00; }
button.danger { background: #d32f2f; }
button.danger:hover { background: #b71c1c; }

input, select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

#add-keyword-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

#keyword-input { flex: 1; min-width: 200px; }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.6rem;
    border-bottom: 1px solid #eee;
}

th {
    font-weight: 600;
    color: #666;
    font-size: 0.85rem;
    text-transform: uppercase;
}

/* Comments */
.comment-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

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

.comment-meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.3rem;
}

.comment-meta a {
    color: #ff6600;
    text-decoration: none;
}

.comment-text {
    font-size: 0.9rem;
    max-height: 300px;
    overflow-y: auto;
}

.keyword-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1565c0;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-right: 0.3rem;
}

/* Filters */
.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Options */
.option-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.option-item label {
    width: 300px;
    flex-shrink: 0;
    font-weight: 500;
    white-space: nowrap;
}

/* Worker status */
#worker-details {
    font-size: 0.9rem;
}

#worker-details p {
    margin-bottom: 0.3rem;
}

.warning {
    color: #e65100;
    font-weight: 500;
}

#comments-info {
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: #666;
}

/* Tooltips */
.info-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #666;
    font-size: 0.65rem;
    font-style: italic;
    font-weight: 700;
    cursor: help;
    vertical-align: middle;
    margin-left: 2px;
    position: relative;
}

.info-tooltip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 400;
    white-space: normal;
    width: 240px;
    text-align: left;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 100;
}

.info-tooltip:hover::after {
    opacity: 1;
}
