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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #0a0e27;
    color: #e0e0e0;
    padding: 20px;
    min-height: 100vh;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 2px solid #1a2238;
}

.header h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #00ff88, #00ccff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.header .subtitle {
    color: #7c8db5;
    font-size: 0.95rem;
}

.legend {
    max-width: 1600px;
    margin: 0 auto 30px auto;
    background: #131a31;
    border-radius: 8px;
    padding: 15px 20px;
    border: 1px solid #1a2238;
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #7c8db5;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.column {
    background: #131a31;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #1a2238;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.column-header {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #1a2238;
    display: flex;
    align-items: center;
    gap: 10px;
}

.column-header .icon {
    font-size: 1.4rem;
}

.column-header .count {
    margin-left: auto;
    background: #1a2238;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #7c8db5;
}

.add-card-btn {
    background: #1a2238;
    border: 2px dashed #2a3550;
    color: #7c8db5;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-align: center;
    margin-bottom: 15px;
}

.add-card-btn:hover {
    border-color: #00ff88;
    color: #00ff88;
    background: rgba(0, 255, 136, 0.05);
}

.cards-container {
    flex: 1;
}

.card {
    background: #1a2238;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #2a3550;
    transition: all 0.3s ease;
    cursor: grab;
    position: relative;
}

.card:active {
    cursor: grabbing;
}

.card:hover {
    transform: translateY(-2px);
    border-color: #00ff88;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.2);
}

.card.sortable-ghost {
    opacity: 0.4;
    background: #2a3550;
}

.card.sortable-drag {
    opacity: 0.8;
    transform: rotate(2deg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 10px;
}

.card-title {
    font-weight: 600;
    color: #f0f0f0;
    font-size: 1rem;
    flex: 1;
    cursor: pointer;
}

.card-title:hover {
    color: #00ff88;
}

.priority {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.priority.high {
    background: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
    border: 1px solid #ff4d4d;
}

.priority.medium {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid #ffc107;
}

.priority.low {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid #00ff88;
}

.card-meta {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #7c8db5;
}

.assignee {
    background: #2a3550;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.card-notes {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #2a3550;
    font-size: 0.9rem;
    color: #9ca8c7;
    line-height: 1.5;
}

.task-number {
    background: #2a3550;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #00ccff;
    font-weight: 600;
}

.card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    gap: 5px;
}

.card:hover .card-actions {
    display: flex;
}

.card-action-btn {
    background: #2a3550;
    border: none;
    color: #7c8db5;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}

.card-action-btn:hover {
    background: #ff4d4d;
    color: white;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #5a6b8c;
    font-style: italic;
    border: 2px dashed #2a3550;
    border-radius: 8px;
    margin-top: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.95);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background: #131a31;
    border: 1px solid #1a2238;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s;
}

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

.modal-header h2 {
    color: #f0f0f0;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    color: #7c8db5;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-btn:hover {
    color: #ff4d4d;
}

#card-form {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #9ca8c7;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: #1a2238;
    border: 1px solid #2a3550;
    color: #e0e0e0;
    padding: 10px;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00ff88;
}

.form-group textarea {
    resize: vertical;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-primary {
    background: linear-gradient(135deg, #00ff88, #00ccff);
    color: #0a0e27;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.btn-secondary {
    background: #2a3550;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background: #3a4560;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #131a31;
    color: #e0e0e0;
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid #00ff88;
    box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Loading */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.95);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #1a2238;
    border-top-color: #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .board {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 2rem;
    }

    .toast {
        right: 10px;
        left: 10px;
        bottom: 10px;
    }
}
