/* static/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: #fafbfc;
    color: #1a1a1a;
    line-height: 1.6;
    font-size: 15px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
}

header {
    background: white;
    border-bottom: 1px solid #e8eaed;
    padding: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    height: 64px;
}

a {
    text-decoration: none;
}

nav a {
    color: #5f6368;
    text-decoration: none;
    margin: 0 20px;
    font-weight: 500;
    font-size: 14px;
    letter-spacing: 0.2px;
    transition: color 0.2s ease;
    position: relative;
}

nav a:hover {
    color: #1967d2;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -18px;
    left: 0;
    right: 0;
    height: 3px;
    background: #1967d2;
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

nav a:hover::after {
    transform: scaleX(1);
}

.auth-form {
    max-width: 440px;
    margin: 80px auto;
    background: white;
    padding: 48px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8eaed;
}

.auth-form h2 {
    margin-bottom: 32px;
    text-align: center;
    color: #1a1a1a;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #3c4043;
    font-size: 14px;
    letter-spacing: 0.2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: white;
    color: #1a1a1a;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1967d2;
    box-shadow: 0 0 0 3px rgba(25, 103, 210, 0.1);
}

.form-group textarea {
    min-height: 140px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: #1967d2;
    color: white;
    box-shadow: 0 1px 2px rgba(25, 103, 210, 0.2);
}

.btn-primary:hover {
    background: #1557b0;
    box-shadow: 0 2px 4px rgba(25, 103, 210, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-danger {
    background: #ea4335;
    color: white;
    box-shadow: 0 1px 2px rgba(234, 67, 53, 0.2);
}

.btn-danger:hover {
    background: #d33426;
    box-shadow: 0 2px 4px rgba(234, 67, 53, 0.3);
    transform: translateY(-1px);
}

.btn-success {
    background: #34a853;
    color: white;
    box-shadow: 0 1px 2px rgba(52, 168, 83, 0.2);
}

.btn-success:hover {
    background: #2d9248;
    box-shadow: 0 2px 4px rgba(52, 168, 83, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #5f6368;
    border: 1px solid #dadce0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #c8cacd;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.error {
    color: #c5221f;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #fce8e6;
    border-radius: 8px;
    border: 1px solid #f9dedc;
    font-size: 14px;
    line-height: 1.5;
}

.table-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #e8eaed;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

thead {
    background: #f8f9fa;
    border-radius: 8px;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e8eaed;
}

th {
    font-weight: 600;
    color: #3c4043;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    color: #5f6368;
    font-size: 14px;
}

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

tbody tr {
    transition: background-color 0.15s ease;
}

tbody tr:hover {
    background: #f8f9fa;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 24px;
    gap: 8px;
}

.pagination a {
    padding: 10px 16px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    text-decoration: none;
    color: #5f6368;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    background: white;
}

.pagination a:hover {
    background: #f8f9fa;
    border-color: #c8cacd;
    transform: translateY(-1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pagination .active {
    background: #1967d2;
    color: white;
    border-color: #1967d2;
    box-shadow: 0 1px 2px rgba(25, 103, 210, 0.2);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 32px;
    border-radius: 16px;
    max-width: 640px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: 1px solid #e8eaed;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8eaed;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: -0.3px;
}

.close {
    font-size: 28px;
    cursor: pointer;
    color: #5f6368;
    line-height: 1;
    transition: color 0.2s ease;
    padding: 4px;
}

.close:hover {
    color: #1a1a1a;
}

.header-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    align-items: center;
}

.lang-switcher {
    display: flex;
    gap: 6px;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #e8eaed;
}

.lang-btn {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: white;
    color: #1967d2;
}

.lang-btn.active {
    background: white;
    color: #1967d2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.key-input-group {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e8eaed;
}

.key-input-group label {
    font-weight: 600;
    color: #3c4043;
    margin-bottom: 8px;
}

.key-input-group input {
    margin-top: 8px;
    background: white;
}

#keys-container .key-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

#keys-container .key-row input {
    flex: 1;
}

.editor-container {
    border: 1px solid #dadce0;
    border-radius: 10px;
    min-height: 320px;
    padding: 16px;
    background: white;
    transition: border-color 0.2s ease;
}

.editor-container:focus-within {
    border-color: #1967d2;
    box-shadow: 0 0 0 3px rgba(25, 103, 210, 0.1);
}

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

::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 10px;
    border: 2px solid #f8f9fa;
}

::-webkit-scrollbar-thumb:hover {
    background: #c8cacd;
}

/* Smooth animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal.active .modal-content {
    animation: fadeIn 0.3s ease;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #007bff;
}

.current-task, .last-error {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #ddd;
}

.last-error {
    border-color: #dc3545;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.status-pending {
    background: #ffc107;
    color: #000;
}

.status-processing {
    background: #2196f3;
    color: #fff;
}

.status-completed {
    background: #4caf50;
    color: #fff;
}

.status-error {
    background: #f44336;
    color: #fff;
}

.error-message {
    color: #f44336;
    font-size: 12px;
    cursor: help;
}

/* Filters Section */
.filters-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.filters-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.filters-form input,
.filters-form select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}