/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

header h1 i {
    margin-right: 15px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* メインコンテンツ */
main {
    padding: 40px;
}

/* フォームセクション */
.task-form-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.task-form-section h2 {
    color: var(--text-primary);
    margin-bottom: 25px;
    font-size: 1.5em;
    font-weight: 600;
}

.task-form-section h2 i {
    color: var(--primary-color);
    margin-right: 10px;
}

/* フォームスタイル */
.form-group {
    margin-bottom: 20px;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.form-row .form-group {
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.required {
    color: var(--danger-color);
}

input[type="text"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea {
    resize: vertical;
}

/* ボタン */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

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

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

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

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

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

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

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

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

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

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* フィルターセクション */
.filter-section {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.filter-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.filter-group i {
    margin-right: 5px;
    color: var(--primary-color);
}

/* タスクリストセクション */
.task-list-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.task-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.task-list-header h2 {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--text-primary);
}

.task-list-header h2 i {
    color: var(--primary-color);
    margin-right: 10px;
}

.task-count {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    margin-left: 10px;
}

/* タスクカード */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.task-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.task-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

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

.task-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.task-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.task-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
    line-height: 1.6;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-status-未完了 {
    background: #fee2e2;
    color: #991b1b;
}

.badge-status-進行中 {
    background: #dbeafe;
    color: #1e40af;
}

.badge-status-完了 {
    background: #d1fae5;
    color: #065f46;
}

.badge-priority-高 {
    background: #fee2e2;
    color: #991b1b;
}

.badge-priority-中 {
    background: #fef3c7;
    color: #92400e;
}

.badge-priority-低 {
    background: #e5e7eb;
    color: #374151;
}

.badge i {
    font-size: 0.9em;
}

.task-due-date {
    color: var(--text-secondary);
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.task-due-date i {
    color: var(--primary-color);
}

.task-due-date.overdue {
    color: var(--danger-color);
    font-weight: 600;
}

/* ローディング・空状態 */
.loading,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.loading i,
.empty-state i {
    font-size: 3em;
    margin-bottom: 15px;
    color: var(--primary-color);
    opacity: 0.5;
}

.loading {
    font-size: 1.2em;
}

.empty-state {
    font-size: 1.1em;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 1.3em;
}

.modal-content h3 i {
    color: var(--warning-color);
    margin-right: 10px;
}

.modal-content p {
    margin-bottom: 25px;
    color: var(--text-secondary);
}

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

/* フッター */
footer {
    background: var(--card-bg);
    text-align: center;
    padding: 25px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2em;
    }

    main {
        padding: 20px;
    }

    .task-form-section,
    .filter-section,
    .task-list-section {
        padding: 20px;
    }

    .form-row {
        flex-direction: column;
    }

    .form-row .form-group {
        width: 100%;
    }

    .filter-container {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .task-list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-card {
    animation: fadeIn 0.3s ease;
}
