/* 백업 관리 UI 스타일 */

/* 헤더 백업 버튼 */
.header-backup-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-backup-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.header-backup-btn svg {
    width: 20px;
    height: 20px;
}

/* 백업 모달 기본 스타일 */
.backup-modal {
    max-width: 900px;
    width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.backup-modal .modal-body {
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

/* 백업 모달 액션 버튼들 */
.backup-modal-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.backup-action-btn {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.backup-action-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.backup-action-btn:active {
    transform: translateY(0);
}

/* 백업 상태 섹션 */
.backup-status-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9ff, #e3f2fd);
    border-radius: 12px;
    border: 1px solid #e3f2fd;
}

.backup-status-section h3 {
    margin: 0 0 1rem 0;
    color: #1976d2;
    font-size: 1.25rem;
}

.backup-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.status-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid #4CAF50;
    transition: transform 0.2s ease;
}

.status-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.status-card.monthly-backup {
    border-left-color: #FF9800;
}

.status-card h4 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.1rem;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.status-info span {
    font-size: 0.9rem;
}

.backup-time {
    color: #666;
    font-style: italic;
}

.backup-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    width: 100%;
}

.backup-btn:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0);
    transform: translateY(-1px);
}

.backup-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 백업 히스토리 섹션 */
.backup-history-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.backup-history-section h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.25rem;
}

.backup-history-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.backup-history-controls button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.backup-history-controls button:hover {
    background: #45a049;
}

.backup-history-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
}

.history-item {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f5f5f5;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item.completed {
    border-left: 4px solid #4CAF50;
}

.history-item.failed {
    border-left: 4px solid #f44336;
}

.history-item.skipped {
    border-left: 4px solid #2196F3;
    background: #f8f9ff;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-type {
    font-weight: 600;
    color: #333;
}

.history-status {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: #f0f0f0;
}

.history-time {
    font-size: 0.875rem;
    color: #666;
}

.history-details {
    font-size: 0.875rem;
    color: #666;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.history-details a {
    color: #1976d2;
    text-decoration: none;
}

.history-details a:hover {
    text-decoration: underline;
}

/* 백업 설정 섹션 */
.backup-settings-section {
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff8e1, #fff3e0);
    border-radius: 12px;
    border: 1px solid #ffcc02;
}

.backup-settings-section h3 {
    margin: 0 0 1.5rem 0;
    color: #f57c00;
    font-size: 1.25rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.setting-item.full-width {
    grid-column: 1 / -1;
}

.setting-item label {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.setting-item input[type="time"],
.setting-item input[type="text"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.setting-item button {
    background: #FF9800;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    transition: background 0.2s;
}

.setting-item button:hover {
    background: #F57C00;
}

/* 토글 스위치 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 알림 옵션 */
.notification-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.notification-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.notification-options input[type="checkbox"] {
    margin: 0;
}

/* 설정 저장 버튼 */
.save-settings-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
    display: block;
    margin: 0 auto;
}

.save-settings-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
}

/* 모달 푸터 버튼들 */
.modal-footer .btn-warning {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.modal-footer .btn-warning:hover {
    background: linear-gradient(135deg, #F57C00, #EF6C00);
    transform: translateY(-1px);
}

.modal-footer .btn-info {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.modal-footer .btn-info:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0);
    transform: translateY(-1px);
}

.modal-footer .btn-secondary {
    background: #666;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.modal-footer .btn-secondary:hover {
    background: #555;
    transform: translateY(-1px);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .backup-modal {
        width: 95vw;
        max-height: 95vh;
    }
    
    .backup-status-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .backup-history-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .history-details {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer button {
        width: 100%;
    }
}

/* 로딩 애니메이션 */
@keyframes loading {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.loading {
    animation: loading 1.5s infinite;
}

/* 성공/실패 색상 */
.text-success { color: #4CAF50; }
.text-warning { color: #FF9800; }
.text-error { color: #f44336; }
.text-info { color: #2196F3; }

/* 스크롤바 스타일링 */
.backup-modal .modal-body::-webkit-scrollbar,
.backup-history-list::-webkit-scrollbar {
    width: 6px;
}

.backup-modal .modal-body::-webkit-scrollbar-track,
.backup-history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.backup-modal .modal-body::-webkit-scrollbar-thumb,
.backup-history-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.backup-modal .modal-body::-webkit-scrollbar-thumb:hover,
.backup-history-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 탭 UI 스타일 (백업/복원) */
.backup-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
}

.backup-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
}

.backup-tab:hover {
    color: #333;
    background: rgba(76, 175, 80, 0.05);
}

.backup-tab.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

#backupTabContent,
#restoreTabContent {
    display: none;
    animation: fadeIn 0.3s ease;
}

#backupTabContent.active,
#restoreTabContent.active {
    display: block;
}

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

/* 복원 가이드 */
.restore-guide {
    background: linear-gradient(135deg, #e3f2fd, #f8f9ff);
    border: 1px solid #2196F3;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.restore-guide h3 {
    margin: 0 0 1rem 0;
    color: #1976d2;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guide-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.guide-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

.guide-step-content {
    flex: 1;
}

.guide-step-content strong {
    color: #333;
    display: block;
    margin-bottom: 0.25rem;
}

.guide-step-content p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.safety-notice {
    background: linear-gradient(135deg, #fff3e0, #ffe8cc);
    border: 1px solid #FF9800;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.safety-notice strong {
    color: #F57C00;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.safety-notice p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* 파일 업로드 영역 */
.upload-zone {
    border: 3px dashed #ccc;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, #fafafa, #f5f5f5);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 1.5rem;
}

.upload-zone:hover {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f1f8f4, #e8f5e9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.15);
}

.upload-zone.dragging {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-width: 4px;
    transform: scale(1.02);
}

.upload-zone svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: #4CAF50;
}

.upload-zone h3 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.25rem;
}

.upload-zone p {
    margin: 0.5rem 0;
    color: #666;
    font-size: 0.95rem;
}

.upload-zone .file-types {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #666;
}

.upload-zone input[type="file"] {
    display: none;
}

/* 복원 미리보기 */
#restorePreview {
    display: none;
    margin-bottom: 1.5rem;
}

#restorePreview.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.stat-item {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-item.total {
    border-left: 4px solid #2196F3;
}

.stat-item.valid {
    border-left: 4px solid #4CAF50;
}

.stat-item.invalid {
    border-left: 4px solid #f44336;
}

.stat-label {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
}

.stat-value.total-color {
    color: #2196F3;
}

.stat-value.valid-color {
    color: #4CAF50;
}

.stat-value.invalid-color {
    color: #f44336;
}

/* 복원 진행률 표시 */
#restoreProgressContainer {
    display: none;
    margin-bottom: 1.5rem;
}

#restoreProgressContainer.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.progress-bar {
    width: 100%;
    height: 40px;
    background: #f0f0f0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
    border-radius: 20px;
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

#restoreProgressText {
    text-align: center;
    margin-top: 0.75rem;
    color: #666;
    font-size: 0.9rem;
}

/* 복원 액션 버튼들 */
.restore-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.restore-actions button {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.restore-actions .btn-primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.restore-actions .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.restore-actions .btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.restore-actions .btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.restore-actions .btn-secondary:hover {
    background: #d0d0d0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 반응형 디자인 추가 */
@media (max-width: 768px) {
    .backup-tab {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .restore-guide {
        padding: 1rem;
    }

    .guide-step {
        flex-direction: column;
        align-items: flex-start;
    }

    .upload-zone {
        padding: 2rem 1rem;
    }

    .upload-zone svg {
        width: 48px;
        height: 48px;
    }

    .preview-stats {
        grid-template-columns: 1fr;
    }

    .restore-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .restore-actions button {
        width: 100%;
    }
}
