/**
 * @file style.css
 * @description Smart To-Do galvenais stils: responsīvs dizains, dark mode, komponentes
 * @author Smart To-Do sistēma
 * @version 1.0
 */

 /* ---------- RESET & GLOBĀLIE MAINĪGIE ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }


/* Gaišais režīms (noklusējums) */
:root {
    --bg-primary: #f5f7fa;
    --bg-card: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --border: #dee2e6;
    --primary: #4361ee;
    --primary-hover: #3a56d4;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
}


/* Tumšais režīms — aktivizējas ar .dark klasi uz body */
body.dark {
    --bg-primary: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border: #2d3748;
    --shadow: 0 4px 6px rgba(0,0,0,0.3);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}


/* ---------- KONTEINERIS UN GALVENE ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}

.back-btn {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--bg-card);
}

.dark-mode-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-primary);
}


/* ---------- KONTEINERIS UN GALVENE ---------- */
.nav-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.nav-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    transition: transform 0.2s;
    text-align: center;
}

.nav-card:hover { transform: translateY(-5px); }

.nav-icon { font-size: 48px; margin-bottom: 16px; }

.form-card, .list-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--border); color: var(--text-primary); }

.table-container { overflow-x: auto; background: var(--bg-card); border-radius: 16px; padding: 20px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-primary); font-weight: 600; }

.priority-badge { padding: 4px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.priority-high { background: #fee2e2; color: #dc2626; }
.priority-medium { background: #fff3e0; color: #f59e0b; }
.priority-low { background: #e3fcec; color: #10b981; }
body.dark .priority-high { background: #7f1a1a; color: #fca5a5; }
body.dark .priority-medium { background: #78350f; color: #fbbf24; }
body.dark .priority-low { background: #064e3b; color: #6ee7b7; }

.category-badge { padding: 4px 8px; border-radius: 12px; font-size: 12px; }
.status-badge { padding: 4px 8px; border-radius: 12px; font-size: 12px; }
.status-completed { background: #d1fae5; color: #065f46; }
.status-pending { background: #fed7aa; color: #92400e; }

.task-completed { opacity: 0.7; text-decoration: line-through; }

.actions .btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    margin: 0 4px;
    padding: 4px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}
.modal-content {
    background: var(--bg-card);
    margin: 50px auto;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
}
.close { float: right; font-size: 28px; cursor: pointer; }

.progress-section {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
}
.progress-bar {
    height: 30px;
    background: var(--border);
    border-radius: 15px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #818cf8);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.search-filter {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}
.search-input, .filter-select {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
}

.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--bg-primary);
    border-radius: 8px;
}


/* ---------- PAZIŅOJUMI ---------- */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}
.notification.success { background: var(--success); }
.notification.error { background: var(--danger); }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 768px) {
    .two-columns { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .search-filter { flex-direction: column; }
}