/**
 * Kanban Todo Board Styles
 */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: #0076B6;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-brand .logo {
    width: 32px;
    height: 32px;
    color: white;
    filter: brightness(0) invert(1);
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

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

.header-actions .btn-primary,
.header-actions .btn-secondary {
    background: #e8f4f8;
    color: #333;
}

.header-actions .btn-primary:hover,
.header-actions .btn-secondary:hover {
    background: #d0e8f0;
}

/* Board Container */
.board {
    flex: 1;
    padding: 2rem;
    overflow-x: auto;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

/* Empty State */
.empty-state {
    margin: 4rem auto;
    text-align: center;
    color: #999;
    font-size: 1.2rem;
}

/* Group Column */
.group-column {
    min-width: 300px;
    max-width: 300px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

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

.group-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
}

/* Todos Container */
.todos-container {
    padding: 0.5rem;
    min-height: 50px;
}

.todos-container.icebox-todos {
    min-height: 40px;
    background: #f9fbfc;
    border-top: 1px solid #e8eff4;
}

/* Todo Item */
.todo-item {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: move;
    transition: all 0.2s;
}

.todo-item:hover {
    background: #f0f0f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.todo-item.completed .todo-title {
    text-decoration: line-through;
    color: #999;
}

.todo-item.icebox {
    background: #f0f8ff;
    border-color: #cfe4f7;
}

/* Hide completed todos when filter is active */
#app.hide-completed .todo-item.completed {
    display: none;
}

.todo-checkbox {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.todo-title {
    flex: 1;
    font-size: 0.95rem;
    word-break: break-word;
    cursor: pointer;
    border-radius: 2px;
    padding: 2px 4px;
    transition: background 0.2s;
}

.todo-title:hover:not(.editing) {
    background: rgba(52, 152, 219, 0.1);
}

.todo-title.editing {
    background: #fff;
    outline: 2px solid #3498db;
    cursor: text;
}

/* Drag States */
.todo-ghost {
    opacity: 0.4;
    background: #e3f2fd;
}

.todo-drag {
    background: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Buttons */
.btn-primary {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0.25rem;
}

.btn-icon:hover {
    opacity: 1;
}

.btn-add-todo {
    background: transparent;
    border: 2px dashed #ddd;
    color: #999;
    padding: 0.75rem;
    margin: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-add-todo:hover {
    border-color: #3498db;
    color: #3498db;
    background: #f0f8ff;
}

/* Icebox Section */
.icebox-section {
    margin-top: auto;
}

.icebox-header {
    padding: 0.75rem 1rem;
    background: #e8f4fd;
    border-top: 2px solid #b3d9f2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
}

.icebox-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2980b9;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icebox-count {
    background: #2980b9;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    min-width: 20px;
    text-align: center;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    min-width: 400px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.modal-content-wide {
    min-width: 600px;
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.modal-content input[type="text"],
.modal-content textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
}

.modal-content textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-content input[type="text"]:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: #3498db;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #2c3e50;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 2000;
    animation: slideIn 0.3s;
}

.toast.hidden {
    display: none;
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

.toast.info {
    background: #3498db;
}

@keyframes slideIn {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Drag Hint Animation */
@keyframes dragHint {
    0% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(28.28px, 28.28px);
    }
    100% {
        transform: translate(0, 0);
    }
}

.drag-hint-animation {
    animation: dragHint 1.5s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .board {
        padding: 1rem;
    }

    .group-column {
        min-width: 280px;
        max-width: 280px;
    }

    .modal-content {
        min-width: 90%;
        margin: 1rem;
    }
}

/* Workspace Auth Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.auth-overlay.hidden {
    display: none;
}

.auth-modal {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.auth-modal h2 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.auth-modal p {
    color: #666;
    margin-bottom: 1.5rem;
}

.auth-modal input[type="password"] {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.auth-modal input[type="password"]:focus {
    outline: none;
    border-color: #3498db;
}

.auth-modal button {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
}

.auth-error {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.auth-error.hidden {
    display: none;
}

/* Scrollbar styling */
.todos-container::-webkit-scrollbar,
.board::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.todos-container::-webkit-scrollbar-track,
.board::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.todos-container::-webkit-scrollbar-thumb,
.board::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.todos-container::-webkit-scrollbar-thumb:hover,
.board::-webkit-scrollbar-thumb:hover {
    background: #555;
}
