/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Header */
header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-container h1 {
    color: #007bff;
}

.nav-container ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-container a {
    text-decoration: none;
    color: #666;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s;
}

.nav-container a:hover {
    background: #f8f9fa;
    color: #007bff;
}

/* Main content */
main {
    width: 100%;
    margin: 60px 0 40px 0;
    padding: 20px;
    height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: auto;
}

/* Footer */
footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 20px;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 100;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Auth pages */
.auth-container {
    max-width: 400px;
    margin: 50px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.auth-tabs button {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.auth-tabs button.active {
    border-bottom-color: #007bff;
    color: #007bff;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.message {
    padding: 10px;
    border-radius: 4px;
    margin-top: 15px;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.hidden {
    display: none !important;
}

/* Dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    margin-bottom: 30px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-info {
    font-weight: 500;
    color: #666;
}

.projects-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.project-card h4 {
    color: #007bff;
    margin-bottom: 10px;
}

/* Kanban Board */
.kanban-board {
    margin-top: 20px;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kanban-container {
    display: flex;
    gap: 20px;
}

.kanban-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    flex: 3;
}

.chat-panel {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    max-height: 600px;
}

.chat-panel h4 {
    padding: 15px;
    margin: 0;
    background: #007bff;
    color: white;
    border-radius: 8px 8px 0 0;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    max-height: 400px;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.chat-message strong {
    color: #007bff;
}

.chat-form {
    display: flex;
    padding: 15px;
    gap: 10px;
    border-top: 1px solid #ddd;
}

.chat-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.kanban-column {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    min-height: 400px;
}

.kanban-column h4 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 18px;
}

.column-content {
    min-height: 300px;
}

.task-card {
    background: white;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    cursor: default;
}

.task-card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.task-card h5 {
    background: #e3f2fd;
    padding: 8px 12px;
    margin: -15px -15px 10px -15px;
    border-radius: 6px 6px 0 0;
    cursor: move;
    user-select: none;
}

.task-card h5:hover {
    background: #bbdefb;
}

.time-controls {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.add-task-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 2px dashed #007bff;
    color: #007bff;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.add-task-btn:hover {
    background: #007bff;
    color: white;
}

/* Drag and Drop Visual Effects */
.task-card.dragging {
    opacity: 0.5;
    transform: rotate(5deg) scale(0.95);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    cursor: grabbing !important;
    z-index: 1000;
}

body.dragging-active {
    cursor: grabbing !important;
    user-select: none;
}

body.dragging-active * {
    pointer-events: none;
}

body.dragging-active .task-card.dragging,
body.dragging-active .kanban-column,
body.dragging-active .column-content {
    pointer-events: all;
}

body.dragging-active .task-card.dragging {
    cursor: grabbing !important;
}

.column-content.drag-over,
.kanban-column.drag-over {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px dashed #007bff;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.column-content.drag-over::before,
.kanban-column.drag-over::before {
    content: "↗ Suelta aquí para mover la tarea";
    display: block;
    text-align: center;
    padding: 20px;
    color: #007bff;
    font-weight: 500;
    font-style: italic;
}

/* Improved task card hover for drag feedback */
.task-card {
    transition: all 0.2s ease;
}

.task-card:hover:not(.dragging) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Column drop zone indicators */
.kanban-column[data-column="todo"] .column-content.drag-over {
    border-color: #6c757d;
}

.kanban-column[data-column="in_progress"] .column-content.drag-over {
    border-color: #ffc107;
}

.kanban-column[data-column="done"] .column-content.drag-over {
    border-color: #28a745;
}

/* Pulse effect for drop zones */
@keyframes pulse-drop {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.column-content.drag-over {
    animation: pulse-drop 0.6s ease-in-out infinite alternate;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 10px 20px;
    }

    .nav-container ul {
        margin-top: 10px;
    }

    .kanban-container {
        flex-direction: column;
    }

    .kanban-columns {
        grid-template-columns: 1fr;
    }

    .projects-list {
        grid-template-columns: 1fr;
    }
}