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

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

header {
    background-color: #24292e;
    padding: 1rem;
}

header nav {
    max-width: 1200px;
    margin: 0 auto;
}

header .brand {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
}

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

footer {
    text-align: center;
    padding: 2rem;
    color: #666;
    background-color: #f0f0f0;
    margin-top: 2rem;
}

/* Search container */
.search-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.search-container h1 {
    margin-bottom: 1.5rem;
    color: #24292e;
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-row {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
}

.search-input:focus {
    border-color: #0366d6;
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

.search-button {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.search-button:hover {
    background-color: #22863a;
}

.reset-button {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.reset-button:hover {
    background-color: #5a6268;
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-row label {
    font-weight: 500;
}

.state-select {
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
}

/* Translate to Czech checkbox - styled to match grey dropdowns */
.translate-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-weight: 500;
    color: #333;
    transition: background-color 0.2s, border-color 0.2s;
    margin-left: 1rem;
}

.translate-checkbox-label:hover {
    background-color: #f5f5f5;
    border-color: #bbb;
}

.translate-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #666;
}

/* Results */
.results-container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.results-container h2 {
    margin-bottom: 1rem;
    color: #24292e;
}

.no-results {
    color: #666;
    font-style: italic;
}

.results-list {
    list-style: none;
}

.result-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

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

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

.result-title {
    color: #0366d6;
    text-decoration: none;
    font-weight: 600;
}

.result-title:hover {
    text-decoration: underline;
}

.state-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.state-open {
    background-color: #28a745;
    color: white;
}

.state-closed {
    background-color: #cb2431;
    color: white;
}

.result-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #666;
}

.repository {
    color: #586069;
}

.similarity {
    color: #0366d6;
}

.exact-match {
    color: #28a745;
    font-weight: 600;
    background-color: #d4edda;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
}

/* Page size select */
.page-size-select {
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    margin-left: 1rem;
}

/* Results header */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.results-count {
    font-size: 0.875rem;
    color: #666;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.page-link {
    padding: 0.5rem 1rem;
    background-color: #0366d6;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
}

.page-link:hover {
    background-color: #0256b9;
}

.page-info {
    color: #666;
    font-size: 0.875rem;
}

/* Body preview */
.result-body-preview {
    margin: 0.5rem 0;
    color: #586069;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Result actions */
.result-actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 1rem;
}

.detail-link, .github-link {
    font-size: 0.85rem;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.detail-link {
    background-color: #0366d6;
    color: white;
}

.detail-link:hover {
    background-color: #0256b9;
}

.github-link {
    background-color: #f6f8fa;
    color: #24292e;
    border: 1px solid #d0d7de;
}

.github-link:hover {
    background-color: #eaeef2;
}

/* Repository filter - Tag input */
.repo-filter-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.repo-filter-row label {
    font-weight: 500;
}

.tag-input-container {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    min-height: 42px;
}

.tag-input-container:focus-within {
    border-color: #0366d6;
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

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

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: #0366d6;
    color: white;
    border-radius: 4px;
    font-size: 0.875rem;
}

.tag-remove {
    cursor: pointer;
    font-weight: bold;
    margin-left: 0.25rem;
    opacity: 0.8;
}

.tag-remove:hover {
    opacity: 1;
}

#repoSearchInput,
#syncRepoSearchInput {
    flex: 1;
    min-width: 150px;
    border: none;
    outline: none;
    padding: 0.25rem;
    font-size: 1rem;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    max-height: 250px;
    overflow-y: auto;
}

.autocomplete-dropdown.show {
    display: block;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

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

.autocomplete-item:hover,
.autocomplete-item.selected {
    background-color: #f6f8fa;
}

.autocomplete-item.selected {
    background-color: #0366d6;
    color: white;
}

/* Database status banner */
.db-status-banner {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.db-status-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.db-status-icon {
    font-size: 1.25rem;
}

.db-status-message {
    flex: 1;
}

.db-status-warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.db-status-error {
    background-color: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
}

.db-status-info {
    background-color: #d1ecf1;
    border: 1px solid #17a2b8;
    color: #0c5460;
}

.db-status-success {
    background-color: #d4edda;
    border: 1px solid #28a745;
    color: #155724;
}

.db-action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    background-color: #0366d6;
    color: white;
}

.db-action-btn:hover {
    background-color: #0256b9;
}

.db-action-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.db-dismiss-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.5;
    padding: 0 0.5rem;
}

.db-dismiss-btn:hover {
    opacity: 1;
}

/* Search header with import button */
.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-header h1 {
    margin-bottom: 0;
}

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

/* Auth controls */
.auth-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background-color: #e8f5e9;
    border-radius: 4px;
    font-size: 0.85rem;
}

.auth-user {
    color: #2e7d32;
    font-weight: 500;
}

.auth-link {
    color: #0366d6;
    text-decoration: none;
    font-size: 0.85rem;
}

.auth-link:hover {
    text-decoration: underline;
}

.login-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background-color: #24292e;
    color: white;
    border-radius: 4px;
    font-weight: 500;
}

.login-link:hover {
    background-color: #444d56;
    text-decoration: none;
}

.github-icon {
    font-family: 'Font Awesome 5 Brands', 'FontAwesome', sans-serif;
}

.import-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #6c5ce7;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}

.import-btn:hover {
    background-color: #5a4ccc;
}

.import-btn:disabled {
    background-color: #a29bfe;
    cursor: not-allowed;
}

.import-icon {
    font-size: 1.1rem;
    display: inline-block;
}

.import-icon.spinning {
    animation: spin 1s linear infinite;
}

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

.db-stats {
    font-size: 0.85rem;
    color: #666;
    padding: 0.25rem 0.5rem;
    background-color: #f6f8fa;
    border-radius: 4px;
}

/* Sync button */
.sync-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #6c5ce7;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}

.sync-btn:hover {
    background-color: #5a4ccc;
}

.sync-btn:disabled {
    background-color: #a29bfe;
    cursor: not-allowed;
}

.sync-icon {
    font-size: 1.1rem;
    display: inline-block;
}

.sync-icon.spinning {
    animation: spin 1s linear infinite;
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #24292e;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close-btn:hover {
    color: #24292e;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-field {
    margin-bottom: 1.25rem;
}

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

.modal-field > label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #24292e;
}

.field-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #666;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal !important;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e1e4e8;
    background-color: #f6f8fa;
}

.btn-primary {
    padding: 0.6rem 1.25rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-primary:hover {
    background-color: #22863a;
}

.btn-primary:disabled {
    background-color: #94d3a2;
    cursor: not-allowed;
}

.btn-secondary {
    padding: 0.6rem 1.25rem;
    background-color: white;
    color: #24292e;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
}

.btn-secondary:hover {
    background-color: #f6f8fa;
}

/* Sync Result Styles */
.sync-result-success {
    color: #28a745;
}

.sync-result-error {
    color: #cb2431;
}

.sync-stats {
    background-color: #f6f8fa;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

.sync-stats h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #24292e;
}

.sync-stats ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sync-stats li {
    padding: 0.35rem 0;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #e1e4e8;
}

.sync-stats li:last-child {
    border-bottom: none;
}

.sync-stats .stat-label {
    color: #586069;
}

.sync-stats .stat-value {
    font-weight: 600;
    color: #24292e;
}

.sync-timestamp {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e1e4e8;
    font-size: 0.9rem;
    color: #666;
}

.sync-progress {
    text-align: center;
    padding: 1rem 0;
}

.sync-progress-text {
    font-size: 1rem;
    color: #24292e;
    margin-bottom: 0.5rem;
}

/* Real-time issue update highlight animation */
.result-item.issue-updated {
    animation: issue-highlight 2s ease-out;
}

@keyframes issue-highlight {
    0% {
        background-color: #fff3cd;
        box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
    }
    50% {
        background-color: #fff8e1;
        box-shadow: 0 0 5px rgba(255, 193, 7, 0.3);
    }
    100% {
        background-color: transparent;
        box-shadow: none;
    }
}

/* Progressive title translation animations */
.result-title.title-translating {
    opacity: 0.7;
    position: relative;
}

.result-title.title-translating::after {
    content: ' 🔄';
    font-size: 0.8em;
}

.result-title.title-translated {
    animation: title-highlight 2s ease-out;
}

@keyframes title-highlight {
    0% {
        background-color: #d4edda;
        color: #155724;
    }
    50% {
        background-color: #e8f5e9;
    }
    100% {
        background-color: transparent;
        color: inherit;
    }
}

/* AI Summary container and progressive loading */
.ai-summary-container {
    margin-top: 0.5rem;
}

.ai-summary-container .body-preview {
    color: #586069;
    font-size: 0.9rem;
    line-height: 1.5;
}

.ai-summary-container .ai-summary-en,
.ai-summary-container .ai-summary-cs {
    color: #24292e;
    font-size: 0.9rem;
    line-height: 1.5;
    padding: 0.5rem;
    background-color: #f6f8fa;
    border-left: 3px solid #0366d6;
    border-radius: 0 4px 4px 0;
    margin-top: 0.25rem;
}

.ai-summary-container .ai-summary-cs {
    border-left-color: #28a745;
}

/* AI Summary received animation */
.ai-summary-en.summary-received,
.ai-summary-cs.summary-received {
    animation: summary-highlight 2s ease-out;
}

@keyframes summary-highlight {
    0% {
        background-color: #cce5ff;
        box-shadow: 0 0 8px rgba(0, 123, 255, 0.4);
    }
    50% {
        background-color: #e3f2fd;
    }
    100% {
        background-color: #f6f8fa;
        box-shadow: none;
    }
}

/* Issue labels (GitHub-style badges) */
.label-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 4px;
}

.labels-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}
