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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 메모 섹션 */
.memo-section {
    background: linear-gradient(135deg, #fef5e7 0%, #f6e6d3 100%);
    border: 2px solid #f6ad55;
}

.memo-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#daily-memo {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
}

#daily-memo:focus {
    outline: none;
    border-color: #f6ad55;
    box-shadow: 0 0 0 3px rgba(246, 173, 85, 0.1);
}

.memo-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.memo-actions .btn {
    height: 30px;
    font-size: 20px;
    width: 80px;
    white-space: nowrap;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-save-memo {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.btn-save-memo:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.btn-clear-memo {
    background: linear-gradient(135deg, #fc8181 0%, #f56565 100%);
    color: white;
}

.btn-clear-memo:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(252, 129, 129, 0.4);
}

.btn-view-history {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-view-history:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .memo-actions {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    
    .memo-actions .btn {
        height: 30px;
        font-size: 20px;
        width: 80px;
        min-width: 80px;
        white-space: nowrap;
        flex-shrink: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    #daily-memo {
        padding: 12px;
        font-size: 0.9rem;
        min-height: 70px;
    }
    
    .container {
        padding: 10px;
        max-width: 100%;
    }
}

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    color: white;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }
}

.date-display {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .date-display {
        font-size: 1rem;
    }
}

main {
    display: grid;
    gap: 30px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    main {
        gap: 15px;
    }
}

section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    section {
        padding: 15px;
        border-radius: 12px;
        margin-bottom: 10px;
    }
}

section:hover {
    transform: translateY(-5px);
}

section h2 {
    margin-bottom: 20px;
    color: #4a5568;
    font-size: 1.5rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    section h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
        padding-bottom: 8px;
    }
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 15px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .form-group input,
    .form-group select {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 100%;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    button[type="submit"] {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 파일 관리 섹션 */
.file-management-section {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border: 2px solid #e2e8f0;
}

.file-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .btn {
        padding: 10px 15px;
        font-size: 0.85rem;
        min-width: auto;
    }
}

.btn-export {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.btn-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.btn-import {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.btn-import:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(66, 153, 225, 0.4);
}

.btn-autosave {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.btn-autosave:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(237, 137, 54, 0.4);
}

.btn-autosave.active {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.btn-autosave.active:hover {
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

.btn-manual-save {
    background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%);
    color: white;
}

.btn-manual-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(159, 122, 234, 0.4);
}

.file-info {
    background: rgba(102, 126, 234, 0.1);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.file-info p {
    margin: 0 0 10px 0;
    color: #4a5568;
    font-size: 0.9rem;
}

.autosave-status {
    font-weight: 600;
    color: #718096;
    margin: 0 !important;
}

/* 루틴 카드 스타일 */
.routine-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .routine-card {
        padding: 8px 12px;
        margin-bottom: 6px;
        border-radius: 6px;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }
}

.routine-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.routine-card.completed {
    background: #f0fff4;
    border-color: #68d391;
}

.routine-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
}

.routine-name {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .routine-name {
        font-size: 0.9rem;
        white-space: normal;
    }
}

.routine-time {
    background: #667eea;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .routine-time {
        padding: 2px 6px;
        font-size: 0.7rem;
    }
}

.routine-category {
    display: inline-block;
    background: #e2e8f0;
    color: #4a5568;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .routine-category {
        padding: 2px 5px;
        font-size: 0.65rem;
    }
}

.routine-actions {
    display: flex;
    gap: 2px;
    margin-top: 0;
    flex-shrink: 0;
    align-items: center;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .routine-actions {
        gap: 3px;
        margin-top: 8px;
        flex-wrap: wrap;
        width: 100%;
    }
}

.btn {
    padding: 2px 4px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: auto;
    height: 30px;
    width: 80px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .btn {
        padding: 3px 5px;
        font-size: 0.65rem;
        flex: 1;
    }
}

.btn-complete {
    background: #68d391;
    color: white;
}

.btn-complete:hover {
    background: #48bb78;
    transform: translateY(-1px);
}

.btn-delete {
    background: #fc8181;
    color: white;
}

.btn-delete:hover {
    background: #f56565;
    transform: translateY(-1px);
}

.btn-edit {
    background: #4299e1;
    color: white;
}

.btn-edit:hover {
    background: #3182ce;
    transform: translateY(-1px);
}

.btn-history {
    background: #9f7aea;
    color: white;
}

.btn-history:hover {
    background: #805ad5;
    transform: translateY(-1px);
}

/* 통계 섹션 액션 버튼 */
.stats-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-stats:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .stats-actions {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .btn-stats {
        width: 100%;
        max-width: 200px;
        padding: 10px 16px;
        font-size: 0.85rem;
    }
}

/* 알림 섹션 */
.notification-section {
    background: linear-gradient(135deg, #fef5e7 0%, #f6e6d3 100%);
    border: 2px solid #f6ad55;
}

.notification-settings {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.notification-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-weight: 600;
    color: #2d3748;
}

.notification-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.notification-label input[type="checkbox"]:checked + .checkmark {
    background: #48bb78;
    border-color: #48bb78;
}

.notification-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.notification-desc {
    margin: 0;
    color: #718096;
    font-size: 0.9rem;
    margin-left: 32px;
}

.btn-notification {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.btn-notification:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(246, 173, 85, 0.4);
}

.btn-test {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.btn-test:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(66, 153, 225, 0.4);
}

.notification-status {
    margin-top: 15px;
    padding: 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.notification-status-text {
    margin: 0;
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 500;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .notification-settings {
        gap: 15px;
    }
    
    .notification-desc {
        margin-left: 0;
        margin-top: 5px;
    }
    
    .btn-notification {
        width: 100%;
        max-width: 200px;
    }
}

/* 통계 섹션 */
.stats-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .stats-grid {
        gap: 15px;
        justify-content: space-between;
    }
}

.stat-card {
    text-align: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    flex: 1;
    min-width: 80px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .stat-card {
        padding: 8px 12px;
        border-radius: 6px;
        min-width: 70px;
    }
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 2px;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .stat-number {
        font-size: 1.2rem;
    }
}

.stat-label {
    color: #718096;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .stat-label {
        font-size: 0.7rem;
    }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .routine-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .routine-actions {
        flex-wrap: wrap;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.routine-card {
    animation: fadeIn 0.5s ease;
}

/* 완료된 루틴 스타일 */
.routine-card.completed .routine-name {
    text-decoration: line-through;
    color: #68d391;
}

.routine-card.completed .routine-time {
    background: #68d391;
}

/* 빈 상태 메시지 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #718096;
}

.empty-state h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.empty-state p {
    font-size: 0.9rem;
}

/* 반응형 디자인 - 모바일 */
@media (max-width: 768px) {
    .file-buttons {
        flex-direction: column;
    }
    
    .btn {
        min-width: auto;
    }
    
    .file-info {
        padding: 10px;
    }
    
    .file-info p {
        font-size: 0.8rem;
    }
    
    /* 터치 친화적 스타일 */
    button, .btn {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    input, select {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* 모바일에서 호버 효과 제거 */
    .routine-card:hover {
        transform: none;
    }
    
    section:hover {
        transform: none;
    }
    
    button:hover, .btn:hover {
        transform: none;
    }
}
