/* AI ClassNote (AI 클래스노트) - 커스텀 스타일 */

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

/* 기본 폰트 설정 */
body {
    font-family: 'Noto Sans KR', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 로딩 스피너 */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-spinner::before,
.loading-spinner::after {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #4f46e5; /* indigo-600 */
    animation: pulse 1.4s infinite ease-in-out both;
}

.loading-spinner::before {
    animation-delay: -0.32s;
}

.loading-spinner::after {
    animation-delay: -0.16s;
}

@keyframes pulse {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1.0);
    }
}

/* 모달 애니메이션 */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fadeOutScale {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

.animate-fade-in-scale {
  animation: fadeInScale 0.2s ease-out forwards;
}

.animate-fade-out-scale {
  animation: fadeOutScale 0.2s ease-out forwards;
}

/* 토스트 메시지 애니메이션 */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Tailwind prose 스타일 커스터마이징 */
.prose h1 {
    font-size: 1.75rem;
    font-weight: bold;
    color: #1e293b;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.prose h2 {
    font-size: 1.4rem;
    font-weight: bold;
    color: #1d4ed8;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #93c5fd;
}

.prose h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1e40af;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
    border-left: 4px solid #60a5fa;
}

.prose h4 {
    font-size: 1rem;
    font-weight: bold;
    color: #1e293b;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose strong {
    color: #0f172a;
    font-weight: 600;
}

.prose ul, .prose ol {
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding-left: 0;
}

.prose li {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.75rem;
    list-style: none;
}

.prose ul > li::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.5em;
    width: 6px;
    height: 6px;
    background-color: #3b82f6;
    border-radius: 9999px;
}

.prose ol {
    counter-reset: list-counter;
}

.prose ol > li {
    counter-increment: list-counter;
}

.prose ol > li::before {
    content: counter(list-counter) ".";
    position: absolute;
    left: 0.5rem;
    font-weight: 600;
    color: #3b82f6;
}

/* 학생 이름 수정 스타일 */
.student-name-editable {
    transition: all 0.2s ease-in-out;
}

.student-name-editable:hover {
    background-color: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
    padding: 2px 4px;
}

.student-name-input {
    background-color: white;
    border: 2px solid #3b82f6;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: inherit;
    color: inherit;
    min-width: 100px;
    max-width: 200px;
}

.student-name-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 관찰 기록 수정 스타일 */
#observationPanel input[type="text"][readonly] {
    cursor: default;
    transition: all 0.2s ease-in-out;
}

#observationPanel input[type="text"][readonly]:hover {
    background-color: rgba(59, 130, 246, 0.02);
}

#observationPanel input[type="text"]:not([readonly]) {
    cursor: text;
    background-color: white;
    border: 1px solid #3b82f6 !important;
    padding: 4px 8px !important;
    border-radius: 4px;
}

#observationPanel input[type="text"]:not([readonly]):focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* readonly input 스타일 - 일반 텍스트처럼 보이게 */
input[type="text"][readonly] {
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

input[type="text"][readonly]:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

/* 편집 모드 input 스타일 */
input[type="text"]:not([readonly]) {
    cursor: text;
}

/* 커스텀 스크롤바 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 포커스 스타일 */
.focus-ring:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 버튼 호버 효과 */
.btn-hover {
    transition: all 0.2s ease-in-out;
}

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

/* 입력 필드 애니메이션 */
.input-animate {
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.input-animate:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 카드 호버 효과 */
.card-hover {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 페이드 인 애니메이션 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

.slide-up {
    animation: slideUp 0.3s ease-out;
}

/* 반응형 그리드 */
.responsive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

/* 텍스트 선택 스타일 */
::selection {
    background-color: #3b82f6;
    color: white;
}

::-moz-selection {
    background-color: #3b82f6;
    color: white;
}

/* 인쇄 스타일 */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .prose {
        font-size: 12pt;
    }
    
    /* 인쇄 시 세로 레이아웃 */
    #app {
        display: block !important;
    }
    
    aside {
        display: none !important;
    }
    
    main {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .lg\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
}

/* 다크 모드 지원 (미래 확장용) */
@media (prefers-color-scheme: dark) {
    /* 다크 모드 스타일은 필요시 추가 */
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .prose h1,
    .prose h2,
    .prose h3,
    .prose h4 {
        border-width: 3px;
    }
    
    .prose strong {
        font-weight: 700;
    }
}

/* 애니메이션 감소 설정 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 모바일 학생 관리 버튼 기본 숨김 */
.mobile-student-btn {
    display: none;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
    
    .mobile-full {
        width: 100%;
    }
    
    .mobile-text-sm {
        font-size: 0.875rem;
    }
    
    .mobile-p-2 {
        padding: 0.5rem;
    }
    
    /* 모바일에서 세로 레이아웃 */
    #app > div.flex {
        flex-direction: column !important;
    }
    
    /* 사이드바를 숨기고 학생 선택 버튼 표시 */
    aside {
        display: none !important;
    }
    
    /* 메인 영역을 전체 너비로 */
    main {
        width: 100% !important;
        padding: 1rem !important;
    }
    
    /* 그리드를 세로로 변경 */
    .lg\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    
    /* 모바일 학생 관리 버튼 표시 */
    .mobile-student-btn {
        display: flex !important;
    }
    
    /* 헤더 반응형 */
    header h1 {
        font-size: 1.25rem !important;
    }
    
    header .text-sm {
        font-size: 0.75rem !important;
    }
    
    /* 관찰 기록 폼 반응형 */
    .flex.justify-between.items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    
    #observationDate {
        align-self: flex-end;
    }
}

/* 접근성 개선 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 포커스 표시기 */
.focus-visible:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 로딩 상태 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 에러 상태 */
.error {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
}

.error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

/* 성공 상태 */
.success {
    border-color: #10b981 !important;
    background-color: #f0fdf4;
}

.success:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

/* 경고 상태 */
.warning {
    border-color: #f59e0b !important;
    background-color: #fffbeb;
}

.warning:focus {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1) !important;
}

/* 드래그 앤 드롭 영역 */
.drag-drop-area {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.2s ease-in-out;
}

.drag-drop-area.drag-over {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

/* 툴팁 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* 커스텀 체크박스 */
.custom-checkbox {
    position: relative;
    display: inline-block;
}

.custom-checkbox input[type="checkbox"] {
    opacity: 0;
    position: absolute;
}

.custom-checkbox .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* 커스텀 라디오 버튼 */
.custom-radio {
    position: relative;
    display: inline-block;
}

.custom-radio input[type="radio"] {
    opacity: 0;
    position: absolute;
}

.custom-radio .radiomark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #fff;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    transition: all 0.2s ease-in-out;
}

.custom-radio input[type="radio"]:checked + .radiomark {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.custom-radio input[type="radio"]:checked + .radiomark::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    background-color: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
