:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-app: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    --color-hot: #f43f5e;
    --color-urgent: #f59e0b;
    --color-important: #3b82f6;
    
    --task-green: #10b981;
    --task-yellow: #facc15;
    --task-red: #ef4444;
    
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    overflow-x: hidden;
}

/* APP CONTAINER */
.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0.5rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo i {
    font-size: 1.8rem;
    color: var(--primary);
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
}

.logo span {
    color: var(--primary);
}

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

.search-box {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem 0.5rem 2.5rem;
}

.search-box i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    border: none;
    outline: none;
    background: transparent;
    width: 250px;
}

/* BUTTONS */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #fee2e2;
    color: #ef4444;
}

.btn-danger:hover {
    background-color: #fecaca;
}

/* FILTERS */
.filters-bar {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

select {
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    outline: none;
}

/* KANBAN BOARD */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    flex: 1;
}

.kanban-column {
    background-color: #eff6ff80;
    border-radius: var(--radius);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.header-title h2 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.column-hot .header-title i, .column-hot .header-title h2 { color: var(--color-hot); }
.column-urgent .header-title i, .column-urgent .header-title h2 { color: var(--color-urgent); }
.column-important .header-title i, .column-important .header-title h2 { color: var(--color-important); }

.task-count {
    background: rgba(0,0,0,0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.task-list {
    flex: 1;
}

/* TASKS CARDS */
.task-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    cursor: grab;
    border-left: 4px solid var(--task-green);
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.task-card:hover {
    box-shadow: var(--shadow-lg);
}

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

.task-card[data-color="yellow"] { border-left-color: var(--task-yellow); }
.task-card[data-color="red"] { border-left-color: var(--task-red); }

.task-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.task-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.task-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
}

.due-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
}

.badge {
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-near { background: #fef3c7; color: #b45309; }
.badge-expired { background: #fee2e2; color: #b91c1c; }

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    margin: 10% auto;
    border-radius: var(--radius);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 1.2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { font-size: 1.2rem; }

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

#task-form {
    padding: 1.5rem;
}

.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 0.4rem; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.color-picker { display: flex; gap: 1rem; margin-top: 0.5rem; }
.color-option { cursor: pointer; display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.color-dot { width: 14px; height: 14px; border-radius: 50%; }
.color-dot.green { background: var(--task-green); }
.color-dot.yellow { background: var(--task-yellow); }
.color-dot.red { background: var(--task-red); }

.modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.hidden { display: none !important; }

/* LOADER SCREEN */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loader-content { text-align: center; width: 300px; }

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

/* AI ASSISTANT */
.btn-ai-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 900;
}

.ai-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 350px;
    height: 100%;
    background: white;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease-in-out;
}

.ai-sidebar.active { right: 0; }

.ai-header {
    background: var(--primary);
    color: white;
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-history {
    flex: 1;
    padding: 1.2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-message {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    max-width: 85%;
}

.ai-message.bot { background: #f1f5f9; align-self: flex-start; }
.ai-message.user { background: var(--primary); color: white; align-self: flex-end; }

.ai-input-area {
    padding: 1.2rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
}

.btn-audio { background: #f1f5f9; border: none; padding: 0.6rem 0.8rem; border-radius: 50%; cursor: pointer; color: var(--text-muted); }
.btn-audio.recording { background: var(--task-red); color: white; animation: pulse 1.5s infinite; }

.ai-input-area input { flex: 1; border: 1px solid var(--border); border-radius: 20px; padding: 0.5rem 1rem; outline: none; }
.btn-send { background: var(--primary); border: none; width: 35px; height: 35px; border-radius: 50%; color: white; cursor: pointer; }

/* ANIMATIONS */
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

/* RESPONSIVE */
@media (max-width: 1024px) {
    .kanban-board { grid-template-columns: 1fr; }
    .kanban-column { min-height: 300px; }
}

@media (max-width: 768px) {
    .app-header { flex-direction: column; gap: 1rem; align-items: flex-start; }
    .header-actions { width: 100%; flex-wrap: wrap; }
    .search-box { width: 100%; }
    .search-box input { width: 100%; }
}
