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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.login-card h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
    min-height: calc(100vh - 40px);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

header h1 {
    color: #333;
    font-size: 2em;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    background: #f8f9fa;
    font-size: 14px;
}

.api-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.api-status-indicator.status-online {
    background: #28a745;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.5);
}

.api-status-indicator.status-warning {
    background: #ffc107;
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.5);
}

.api-status-indicator.status-offline {
    background: #dc3545;
    box-shadow: 0 0 6px rgba(220, 53, 69, 0.5);
}

.api-status-text {
    color: #495057;
    font-weight: 500;
}

.todo-input-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.todo-input {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.due-date-input {
    flex: 0 0 250px;
    font-size: 14px;
}

.due-date-input-edit {
    width: 100%;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #667eea;
    border-radius: 4px;
    outline: none;
}

.todo-input:focus {
    border-color: #667eea;
}

.todos-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.todo-column {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    min-height: 400px;
}

.todo-column h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 100px;
    transition: background-color 0.2s, border-color 0.2s;
}

.todo-list.drag-over {
    background-color: #e8f4f8;
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 8px;
}

.todo-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.todo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.todo-item.draggable-todo {
    cursor: move;
    cursor: grab;
}

.todo-item.draggable-todo:active {
    cursor: grabbing;
}

.todo-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.todo-item.status-completed {
    opacity: 0.6;
}

.todo-item.status-processing {
    border-left: 4px solid #ffc107;
}

.todo-item.status-pending {
    border-left: 4px solid #6c757d;
}

.todo-item.status-processed {
    border-left: 4px solid #28a745;
}

.todo-status {
    display: flex;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge-clickable {
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.status-badge-clickable:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.status-badge-clickable:active {
    transform: scale(0.98);
}

.status-badge.status-pending {
    background: #e9ecef;
    color: #495057;
}

.status-badge.status-processing {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-processed {
    background: #d4edda;
    color: #155724;
}

.status-badge.status-completed {
    background: #d4edda;
    color: #155724;
}

.spinner {
    display: inline-block;
    width: 10px;
    height: 10px;
    border: 2px solid #856404;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

.todo-text {
    flex: 1;
    color: #333;
    word-wrap: break-word;
}

.todo-due-date {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    padding: 4px 8px;
    background: #f0f7ff;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

.todo-due-date.due-date-editable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.todo-due-date.due-date-editable:hover {
    background: #e0f0ff;
}

.todo-metadata {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
}

.todo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.tag.tag-user {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.tag.tag-ai {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.priority {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.priority.priority-high {
    background: #f8d7da;
    color: #721c24;
}

.priority.priority-medium {
    background: #fff3cd;
    color: #856404;
}

.priority.priority-low {
    background: #d4edda;
    color: #155724;
}

.todo-item .todo-actions {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}


.btn {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-complete {
    background: #28a745;
    color: white;
}

.btn-complete:hover {
    background: #218838;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-delete:hover {
    background: #c82333;
}

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

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

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

.chat-section {
    margin-top: 40px;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    max-height: 600px;
}

.chat-header {
    margin-bottom: 15px;
}

.chat-header h2 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 5px;
}

.chat-subtitle {
    color: #666;
    font-size: 14px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    min-height: 300px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    display: flex;
    max-width: 80%;
}

.chat-message-user {
    align-self: flex-end;
    justify-content: flex-end;
}

.chat-message-assistant {
    align-self: flex-start;
    justify-content: flex-start;
}

.chat-message-content {
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
}

.chat-message-user .chat-message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message-assistant .chat-message-content {
    background: #e9ecef;
    color: #333;
    border-bottom-left-radius: 4px;
}

.chat-input-section {
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.chat-input:focus {
    border-color: #667eea;
}

.chat-input:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .todos-container {
        grid-template-columns: 1fr;
    }
    
    .todo-input-section {
        flex-direction: column;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .chat-message {
        max-width: 90%;
    }
}
