/* ========== RESET E VARIÁVEIS ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores principais */
    --primary-color: #1e3a8a;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1e293b;
    --light-color: #f1f5f9;
    --gray-color: #64748b;
    
    /* Cores de prioridade */
    --priority-baixa: #10b981;
    --priority-media: #3b82f6;
    --priority-alta: #f59e0b;
    --priority-urgente: #ef4444;
    
    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
    
    /* Bordas */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    
    /* Transições */
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark-color);
    padding-bottom: 60px;
}

/* ========== HEADER ========== */
.header {
    background: white;
    box-shadow: var(--shadow-md);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    flex: 1;
    min-width: 250px;
}

.header-title {
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title i {
    color: var(--secondary-color);
}

.header-subtitle {
    color: var(--gray-color);
    font-size: 0.95em;
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ========== BOTÕES ========== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-primary {
    background: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-secondary {
    background: var(--gray-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

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

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

/* ========== KANBAN BOARD ========== */
.kanban-container {
    max-width: 1600px;
    margin: 30px auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.kanban-column {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    min-height: 500px;
    transition: var(--transition);
}

.kanban-column:hover {
    box-shadow: var(--shadow-xl);
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--secondary-color);
}

.column-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.column-title i {
    color: var(--secondary-color);
    font-size: 1.1em;
}

.card-count {
    background: var(--secondary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

.cards-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    padding: 5px;
    max-height: 70vh;
}

.cards-container::-webkit-scrollbar {
    width: 8px;
}

.cards-container::-webkit-scrollbar-track {
    background: var(--light-color);
    border-radius: 10px;
}

.cards-container::-webkit-scrollbar-thumb {
    background: var(--gray-color);
    border-radius: 10px;
}

.cards-container::-webkit-scrollbar-thumb:hover {
    background: var(--dark-color);
}

/* ========== CARDS ========== */
.kanban-card {
    background: white;
    border-radius: var(--border-radius-sm);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: var(--transition);
    border-left: 4px solid var(--secondary-color);
    position: relative;
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

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

.card-title {
    font-size: 1.05em;
    font-weight: 600;
    color: var(--dark-color);
    flex: 1;
    line-height: 1.4;
    cursor: pointer;
}

.card-title:hover {
    color: var(--secondary-color);
}

.card-actions {
    display: flex;
    gap: 8px;
    opacity: 0.7;
    transition: var(--transition);
}

.card-actions:hover {
    opacity: 1;
}

.card-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 5px;
    transition: var(--transition);
    font-size: 0.95em;
}

.card-action-btn:hover {
    background: var(--light-color);
}

.card-action-btn.edit {
    color: var(--warning-color);
}

.card-action-btn.delete {
    color: var(--danger-color);
}

.card-description {
    color: var(--gray-color);
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 0.85em;
    color: var(--gray-color);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--light-color);
}

.card-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.card-meta-item i {
    font-size: 0.9em;
}

.card-priority {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}

.card-priority.baixa {
    background: rgba(16, 185, 129, 0.15);
    color: var(--priority-baixa);
}

.card-priority.media {
    background: rgba(59, 130, 246, 0.15);
    color: var(--priority-media);
}

.card-priority.alta {
    background: rgba(245, 158, 11, 0.15);
    color: var(--priority-alta);
}

.card-priority.urgente {
    background: rgba(239, 68, 68, 0.15);
    color: var(--priority-urgente);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.card-tag {
    background: var(--light-color);
    color: var(--gray-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

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

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid var(--light-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5em;
    color: var(--primary-color);
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    color: var(--gray-color);
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--light-color);
    color: var(--danger-color);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 2px solid var(--light-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========== FORMULÁRIO ========== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95em;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--light-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.95em;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

/* ========== FOOTER ========== */
.footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 99;
}

.footer p {
    color: var(--gray-color);
    font-size: 0.9em;
    margin: 0;
}

/* ========== DRAG AND DROP ========== */
.cards-container.drag-over {
    background: rgba(59, 130, 246, 0.1);
    border: 2px dashed var(--secondary-color);
    border-radius: var(--border-radius-sm);
}

/* ========== ESTADOS VAZIOS ========== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-color);
}

.empty-state i {
    font-size: 3em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95em;
}

/* ========== RESPONSIVO ========== */
@media (max-width: 1200px) {
    .kanban-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-actions {
        justify-content: center;
    }
    
    .btn {
        flex: 1;
        justify-content: center;
        min-width: 120px;
        font-size: 0.85em;
        padding: 10px 16px;
    }
    
    .kanban-container {
        grid-template-columns: 1fr;
        padding: 0 15px;
    }
    
    .modal-content {
        max-width: 100%;
        margin: 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .header-title {
        font-size: 1.4em;
    }
}

@media (max-width: 480px) {
    .header-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

/* ========== ANIMAÇÕES EXTRAS ========== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s infinite;
}

/* ========== UTILITÁRIOS ========== */
.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}

/* ========== CARD DETAILS ========== */
.detail-item {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-color);
}

.detail-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.detail-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-value {
    color: var(--gray-color);
    line-height: 1.6;
}
