@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');

:root {
    --bg-color: #1a1a2e;
    --card-color: rgba(22, 22, 46, 0.8);
    --primary-color: #9a77ff;
    --text-color: #e0e0e0;
    --text-muted-color: #a0a0a0;
    --border-color: rgba(154, 119, 255, 0.2);
    --shadow-color: rgba(154, 119, 255, 0.1);
    --high-priority: #ff77a9;
    --medium-priority: #ffcb6b;
    --low-priority: #82d8ff;
    --xp-bar-color: #ffcb6b;
}

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    background-image: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    padding: 20px;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 800px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    cursor: pointer;
    transition: transform 0.2s;
}

.avatar:hover {
    transform: scale(1.1);
}

header h1 {
    margin-bottom: 0;
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--shadow-color);
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px 0 var(--shadow-color);
}

.stat-card h4 {
    color: var(--text-muted-color);
    margin-bottom: 10px;
    font-weight: 400;
}

.stat-card p {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-card small {
    font-size: 0.8rem;
    color: var(--text-muted-color);
}

.xp-bar-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    height: 10px;
    margin: 10px 0 5px;
    overflow: hidden;
}

.xp-bar {
    background: var(--xp-bar-color);
    height: 100%;
    width: 0%;
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

.achievements-area {
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.achievements-area h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.achievements-list {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.achievement-badge {
    font-size: 2rem;
    color: var(--text-muted-color);
    opacity: 0.3;
    cursor: pointer;
}

.achievement-badge.unlocked {
    opacity: 1;
    color: var(--xp-bar-color);
}

.input-area {
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 15px;
    margin-bottom: 15px;
}

.input-wrapper i {
    color: var(--text-muted-color);
}

#task-input {
    flex-grow: 1;
    background: none;
    border: none;
    color: var(--text-color);
    padding: 15px 10px;
    font-size: 1rem;
    outline: none;
}

.input-options {
    display: flex;
    gap: 10px;
    align-items: center;
}

#due-date-input,
#priority-input {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px;
    border-radius: 8px;
    flex-grow: 1;
}

#add-button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

#add-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(154, 119, 255, 0.4);
}

.task-container {
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.filter-area {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.filter-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted-color);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

#task-list {
    list-style: none;
}

.task-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--low-priority);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.task-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow-color);
}

.task-item[data-priority="high"] {
    border-left-color: var(--high-priority);
}

.task-item[data-priority="medium"] {
    border-left-color: var(--medium-priority);
}

.task-item[data-priority="low"] {
    border-left-color: var(--low-priority);
}

.task-item.completed {
    opacity: 0.5;
    background: #2a2a3e;
}

.task-item.completed .task-details {
    text-decoration: line-through;
}

.task-details {
    flex-grow: 1;
    cursor: pointer;
}

.task-info {
    font-size: 0.8rem;
    color: var(--text-muted-color);
    margin-top: 5px;
}

.task-info span {
    margin-right: 10px;
}

.task-buttons button {
    background: none;
    border: none;
    color: var(--text-muted-color);
    font-size: 1.2rem;
    margin-left: 10px;
    cursor: pointer;
    transition: color 0.2s;
}

.task-buttons .complete-btn:hover {
    color: #28a745;
}

.task-buttons .delete-btn:hover {
    color: #dc3545;
}

.edit-input {
    flex-grow: 1;
    background: var(--bg-color);
    border: 1px solid var(--primary-color);
    border-radius: 5px;
    color: var(--text-color);
    padding: 10px;
    font-size: 1rem;
}

/* アニメーションとログイン画面のスタイル */
.task-item.is-completing {
    animation: complete-animation 0.6s ease-in-out forwards;
}

@keyframes complete-animation {
    0% {
        transform: scale(1);
        box-shadow: 0 6px 20px var(--shadow-color);
    }
    50% {
        transform: scale(1.05);
        opacity: 0.7;
        box-shadow: 0 0 30px var(--xp-bar-color);
    }
    100% {
        transform: scale(1);
        opacity: 0.5;
        background: #2a2a3e;
    }
}

#login-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
}

#login-button {
    background: #4285F4;
    color: white;
    font-size: 1.2rem;
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 20px;
}

#login-button:hover {
    background: #357ae8;
}

#logout-button {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted-color);
    font-size: 1.2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

#logout-button:hover {
    background-color: var(--primary-color);
    color: white;
}

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

.modal-content {
    background: var(--bg-color);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid var(--primary-color);
    width: 90%;
    max-width: 500px;
    position: relative;
    text-align: center;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.avatar-option {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, border 0.2s;
    border: 3px solid transparent;
}

.avatar-option:hover {
    transform: scale(1.1);
    border-color: var(--primary-color);
}