/* AuraTodo Premium Stylesheet */

/* 디자인 시스템 & CSS 변수 정의 */
:root {
    /* 폰트 지정 */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* 다크 테마 색상 (기본값) */
    --bg-color: #0c0a0f; /* 매우 깊고 고급스러운 검은색 계열 */
    --card-bg: rgba(20, 18, 30, 0.95);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --primary: #9333ea;
    --primary-light: #a855f7;
    --primary-glow: rgba(147, 51, 234, 0.35);
    --primary-gradient: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --danger: #f43f5e;
    --danger-hover: #e11d48;
    
    /* 우선순위 색상 */
    --priority-low: #3b82f6;
    --priority-medium: #f97316;
    --priority-high: #ef4444;

    /* 카테고리 태그 배경색 */
    --tag-work: rgba(59, 130, 246, 0.15);
    --tag-work-text: #60a5fa;
    --tag-personal: rgba(168, 85, 247, 0.15);
    --tag-personal-text: #c084fc;
    --tag-shopping: rgba(245, 158, 11, 0.15);
    --tag-shopping-text: #fbbf24;
    --tag-health: rgba(16, 185, 129, 0.15);
    --tag-health-text: #34d399;

    --input-bg: rgba(255, 255, 255, 0.03);
    --input-border: rgba(255, 255, 255, 0.08);
    --input-focus-border: rgba(168, 85, 247, 0.5);

    --scrollbar-thumb: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.2);
    
    --blur-intensity: 24px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 라이트 테마 색상 (단색 흰색 배경용) */
body.light-theme {
    --bg-color: #ffffff; /* 깨끗한 순백색 화면 */
    --card-bg: #fafafa;  /* 카드와 배경을 미세하게 구분하는 소프트 화이트 */
    --card-border: #e4e4e7; /* 가볍고 얇은 테두리 */
    --card-shadow: 0 15px 35px rgba(9, 9, 11, 0.06);
    
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    
    --primary: #7c3aed;
    --primary-light: #8b5cf6;
    --primary-glow: rgba(124, 58, 237, 0.1);
    --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    
    --tag-work: rgba(37, 99, 235, 0.08);
    --tag-work-text: #2563eb;
    --tag-personal: rgba(124, 58, 237, 0.08);
    --tag-personal-text: #7c3aed;
    --tag-shopping: rgba(217, 119, 6, 0.08);
    --tag-shopping-text: #d97706;
    --tag-health: rgba(5, 150, 105, 0.08);
    --tag-health-text: #059669;

    --input-bg: #ffffff;
    --input-border: #e4e4e7;
    --input-focus-border: rgba(124, 58, 237, 0.4);

    --scrollbar-thumb: rgba(0, 0, 0, 0.08);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.15);
}

/* 기본 스타일 초기화 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
    background-color: var(--bg-color);
    padding: 20px;
    transition: var(--transition-smooth);
}

/* 실시간 배경 백드롭 이미지 제거 */
body::before {
    display: none;
}

/* 동적인 장식용 글로우 배경 디스크 제거 */
.glow-bg-circle {
    display: none;
}

/* 앱 메인 래퍼 */
.app-container {
    width: 100%;
    max-width: 600px;
    margin: 40px auto;
    perspective: 1000px;
}

/* 프리미엄 글래스 카드 */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--blur-intensity));
    -webkit-backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    padding: 30px;
    transition: var(--transition-smooth);
    overflow: hidden;
}

/* 헤더 스타일 */
.card-header {
    margin-bottom: 25px;
}

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

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

.brand-icon {
    width: 45px;
    height: 45px;
    background: var(--primary-gradient);
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    box-shadow: 0 8px 20px var(--primary-glow);
}

.brand-icon i {
    width: 24px;
    height: 24px;
}

.brand h1 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 2px;
}

/* 테마 토글 단추 */
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.icon-btn i {
    width: 18px;
    height: 18px;
    transition: transform 0.5s ease;
}

.icon-btn:hover i {
    transform: rotate(15deg);
}

/* 대시보드 통계 프로그레스바 */
.stats-dashboard {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 16px;
    padding: 15px 20px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.stats-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.stats-title {
    color: var(--text-secondary);
    font-weight: 500;
}

.stats-counter {
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-heading);
}

.progress-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--primary-light);
}

/* 필터 패널 */
.filter-panel {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 18px;
    border: 1px solid var(--card-border);
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 검색 박스 */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    pointer-events: none;
    width: 16px;
    height: 16px;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.search-box input:focus {
    outline: none;
    border-color: var(--input-focus-border);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 12px var(--primary-glow);
}

.clear-search-btn {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.clear-search-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.clear-search-btn.hide {
    display: none;
}

/* 필터 칩스 */
.filter-row, .filter-row-secondary {
    display: flex;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.filter-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 55px;
}

.filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.chip {
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.chip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.chip.active {
    background: var(--primary-gradient);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 10px var(--primary-glow);
}

/* 할 일 작성 폼 */
.creator-panel {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 18px;
    border: 1px solid var(--card-border);
    padding: 16px;
    margin-bottom: 25px;
}

.todo-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-row input {
    flex: 1;
    padding: 14px 18px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.input-row input:focus {
    outline: none;
    border-color: var(--input-focus-border);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 12px var(--primary-glow);
}

/* 추가 버튼 */
.submit-btn {
    width: 50px;
    height: 50px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 18px var(--primary-glow);
    transition: var(--transition-smooth);
}

.submit-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 24px var(--primary-glow);
    filter: brightness(1.1);
}

.submit-btn:active {
    transform: translateY(0) scale(0.98);
}

.submit-btn i {
    width: 22px;
    height: 22px;
}

/* 셀렉트 드롭다운 옵션 */
.options-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.option-select {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.option-select label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.option-select label i {
    width: 12px;
    height: 12px;
}

.option-select select {
    padding: 10px 14px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: var(--transition-smooth);
}

.option-select select:focus {
    border-color: var(--input-focus-border);
    background: rgba(255, 255, 255, 0.06);
}

.option-select select option {
    background: #110e20;
    color: #fff;
}

body.light-theme .option-select select option {
    background: #ffffff;
    color: #000;
}

/* 할 일 리스트 컨테이너 */
.todo-list-container {
    max-height: 380px;
    overflow-y: auto;
    padding-right: 6px;
    margin-bottom: 25px;
    position: relative;
}

/* 맞춤형 스크롤바 디자인 */
.todo-list-container::-webkit-scrollbar {
    width: 6px;
}

.todo-list-container::-webkit-scrollbar-track {
    background: transparent;
}

.todo-list-container::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
}

.todo-list-container::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

.todo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 개별 할 일 목록 항목 */
.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    transition: var(--transition-smooth);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

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

.todo-item.deleting {
    animation: fadeOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.92) translateY(-10px);
    }
}

.todo-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.todo-item-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

/* 체크박스 커스터마이징 */
.checkbox-wrapper {
    position: relative;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkbox {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px;
    width: 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--input-border);
    border-radius: 7px;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
}

.checkbox-wrapper:hover .custom-checkbox {
    border-color: var(--primary-light);
    background: rgba(168, 85, 247, 0.05);
}

.checkbox-wrapper input:checked ~ .custom-checkbox {
    background: var(--primary-gradient);
    border-color: transparent;
    box-shadow: 0 0 8px var(--primary-glow);
    animation: popCheckbox 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popCheckbox {
    0% { transform: scale(0.85); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* 체크 아이콘 드로잉 */
.custom-checkbox i {
    color: #ffffff;
    width: 14px;
    height: 14px;
    opacity: 0;
    transform: scale(0.5);
    transition: var(--transition-smooth);
}

.checkbox-wrapper input:checked ~ .custom-checkbox i {
    opacity: 1;
    transform: scale(1);
}

/* 할 일 텍스트 및 상세정보 */
.todo-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.todo-text {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    word-break: break-all;
    transition: var(--transition-smooth);
}

.todo-item.completed .todo-text {
    color: var(--text-muted);
    text-decoration: line-through;
}

.todo-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.time-stamp {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

.time-stamp i {
    width: 10px;
    height: 10px;
}

/* 카테고리 태그 */
.tag-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.tag-work { background: var(--tag-work); color: var(--tag-work-text); }
.tag-personal { background: var(--tag-personal); color: var(--tag-personal-text); }
.tag-shopping { background: var(--tag-shopping); color: var(--tag-shopping-text); }
.tag-health { background: var(--tag-health); color: var(--tag-health-text); }

/* 우선순위 마커 */
.priority-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.priority-low { background-color: var(--priority-low); box-shadow: 0 0 6px var(--priority-low); }
.priority-medium { background-color: var(--priority-medium); box-shadow: 0 0 6px var(--priority-medium); }
.priority-high { background-color: var(--priority-high); box-shadow: 0 0 6px var(--priority-high); }

/* 작업 제어 영역 (우측 정렬) */
.todo-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.4;
    transition: var(--transition-smooth);
    margin-left: 10px;
}

.todo-item:hover .todo-actions {
    opacity: 1;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

.delete-btn:hover {
    color: var(--danger);
    background: rgba(244, 63, 94, 0.1);
}

.delete-btn i {
    width: 16px;
    height: 16px;
}

/* 빈 목록 상태 마크업 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    transition: var(--transition-smooth);
}

.empty-state.hide {
    display: none;
}

.empty-illustration {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    margin-bottom: 16px;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; color: var(--primary-light); border-color: rgba(168, 85, 247, 0.2); }
}

.empty-illustration i {
    width: 32px;
    height: 32px;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 250px;
    line-height: 1.4;
}

/* 푸터 및 제어 영역 */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--card-border);
    padding-top: 20px;
    margin-top: 10px;
}

.footer-stats {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

.text-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.text-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.text-btn.danger {
    color: var(--text-muted);
}

.text-btn.danger:hover {
    color: var(--danger);
    background: rgba(244, 63, 94, 0.08);
}

/* 파티클 축하 효과 */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 100;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    opacity: 0.8;
    border-radius: 50%;
    animation: fall linear forwards;
}

@keyframes fall {
    0% {
        transform: translateY(-20px) rotate(0deg) scale(1);
    }
    100% {
        transform: translateY(105vh) rotate(720deg) scale(0.4);
    }
}

/* 모바일 디바이스 지원 반응형 쿼리 */
@media (max-width: 640px) {
    body {
        padding: 10px;
    }

    .app-container {
        margin: 10px auto;
    }

    .glass-card {
        padding: 20px 16px;
        border-radius: 20px;
    }

    .brand h1 {
        font-size: 1.35rem;
    }

    .brand-icon {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .brand-icon i {
        width: 20px;
        height: 20px;
    }

    .options-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .filter-chips {
        gap: 4px;
    }

    .chip {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .card-footer {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .footer-actions {
        width: 100%;
        justify-content: space-between;
    }
}
