/* 애플 스타일의 폰트 및 기본 스타일 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    color: #1d1d1f;
}

/* 연한 은색 그라데이션 배경 */
.bg-gradient {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ed 100%);
    min-height: 100vh;
}

/* 에디터 탭 스타일 수정 */
.editor-tab {
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.editor-tab.active {
    border-bottom: 2px solid #1d1d1f;
    font-weight: 600;
    color: #000;
}

.editor-tab:hover {
    background-color: #f5f5f7;
    color: #000;
}

/* CKEditor 스타일 추가 조정 */
.cke_chrome {
    border-radius: 0.5rem !important;
    border-color: #e5e7eb !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    overflow: visible !important;
}

.cke_top {
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
    background: #f8f9fa !important;
}

.cke_bottom {
    border-bottom-left-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
}

.cke_contents {
    min-height: 250px !important;
}

.cke_wysiwyg_frame {
    width: 100% !important;
}

/* HTML 에디터 스타일 개선 */
#html-content {
    font-family: 'Courier New', monospace;
    line-height: 1.6;
    tab-size: 2;
    width: 100%;
    min-height: 400px;
    height: 400px;
    resize: vertical;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* 모달 내 내용 스타일 */
#modal-content {
    max-width: 100%;
    overflow-wrap: break-word;
    line-height: 1.6;
    width: 100%;
    overflow-x: auto;
}

#modal-content img {
    max-width: 100%;
    height: auto;
}

#modal-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

#modal-content table td,
#modal-content table th {
    border: 1px solid #ddd;
    padding: 8px;
}

#modal-content ul, 
#modal-content ol {
    padding-left: 2rem;
    margin: 1rem 0;
}

/* 관리자 아이콘 스타일 */
#admin-icon {
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.7);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#admin-icon:hover {
    background-color: #ffffff;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 로그인 섹션 트랜지션 */
#login-section {
    opacity: 1;
    transition: opacity 0.3s ease, height 0.3s ease;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
}

#login-section.hidden {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* 부드러운 트랜지션 효과 */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 공지사항 항목 스타일 */
.notice-item {
    border-radius: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.notice-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

/* 공지사항 헤더 스타일 */
.notice-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

/* 공지사항 제목 스타일 */
.notice-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0;
}

/* 공지사항 날짜 스타일 */
.notice-date {
    font-size: 0.875rem;
    color: #86868b;
}

/* 로그인 섹션 스타일 개선 */
#login-section form {
    width: 100%;
}

#login-section .flex-col {
    gap: 10px;
}

#login-section input[type="password"] {
    padding: 8px 12px;
    height: 40px;
}

#login-section #login-btn {
    height: 40px;
    white-space: nowrap;
    min-width: 80px;
}

/* 관리자 버튼 영역 스타일 */
.admin-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}

.admin-buttons button {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    background-color: #f5f5f7;
    border: 1px solid #e5e5e7;
    color: #1d1d1f;
}

.admin-buttons .edit-btn:hover {
    background-color: #e5e5e7;
}

.admin-buttons .delete-btn:hover {
    background-color: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

/* 모달 애니메이션 */
#post-modal {
    transition: opacity 0.3s ease;
}

#post-modal.show {
    display: flex !important;
    opacity: 1;
}

/* 관리자 섹션 스타일 */
#editor-section {
    transition: all 0.3s ease;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 버튼 스타일 */
button {
    transition: all 0.2s ease;
}

/* 입력 필드 포커스 효과 */
input:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* 입력 필드 전체 너비 사용 */
input[type="text"], 
input[type="password"], 
textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 에디터 컨테이너 스타일 */
.editor-content {
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

/* 숨김 처리 확실하게 */
.hidden {
    display: none !important;
}

/* 반응형 조정 */
@media (max-width: 640px) {
    .container {
        padding-top: 2rem;
        padding-bottom: 2rem;
        padding-left: 1rem;
        padding-right: 1rem;
        width: 100%;
    }
    
    header {
        margin-bottom: 2rem;
    }

    #admin-icon {
        top: 1rem;
        right: 1rem;
    }
    
    /* 모바일용 에디터 크기 조정 */
    .cke_chrome {
        width: 100% !important;
    }
    
    /* 모달 크기 조정 */
    #post-modal .bg-white {
        width: 95% !important;
        margin: 0 auto;
    }
}

/* 공지사항 내용 스타일 개선 - 에디터와 동일한 서식 유지 */
.notice-content {
  padding: 1rem;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
  line-height: 1.6;
}

/* 게시물 내용에 에디터와 동일한 스타일 적용 */
.notice-content h1,
.notice-content h2,
.notice-content h3,
.notice-content h4,
.notice-content h5,
.notice-content h6 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.25;
}

.notice-content h1 { font-size: 2em; }
.notice-content h2 { font-size: 1.5em; }
.notice-content h3 { font-size: 1.25em; }

.notice-content p {
  margin-bottom: 1rem;
}

.notice-content ul,
.notice-content ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  padding-left: 2rem;
}

.notice-content ul {
  list-style-type: disc;
}

.notice-content ol {
  list-style-type: decimal;
}

.notice-content li {
  margin-bottom: 0.25rem;
}

.notice-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

.notice-content table th,
.notice-content table td {
  border: 1px solid #ddd;
  padding: 8px;
}

.notice-content table th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: #f8f9fa;
}

.notice-content img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
}

.notice-content pre {
  background-color: #f5f5f5;
  padding: 1rem;
  border-radius: 0.25rem;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin: 1rem 0;
}

.notice-content blockquote {
  border-left: 3px solid #ddd;
  margin: 1rem 0;
  padding-left: 1rem;
  color: #666;
}

.notice-content a {
  color: #0066cc;
  text-decoration: underline;
}

.notice-content a:hover {
  text-decoration: none;
}

/* 에디터와 게시물 내용 서식 일치를 위한 스타일 */
/* Quill 에디터 스타일 */
.ql-editor, #quill-editor {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    color: #1d1d1f !important;
}

/* 게시물 내용 스타일 - 에디터와 일치 */
.notice-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1d1d1f;
    padding: 16px 0;
}

/* 게시물 내용의 텍스트 서식 */
.notice-content h1, 
.ql-editor h1 {
    font-size: 2em;
    font-weight: bold;
    margin: 0.67em 0;
}

.notice-content h2, 
.ql-editor h2 {
    font-size: 1.5em;
    font-weight: bold;
    margin: 0.83em 0;
}

.notice-content h3, 
.ql-editor h3 {
    font-size: 1.17em;
    font-weight: bold;
    margin: 1em 0;
}

.notice-content p, 
.ql-editor p {
    margin: 1em 0;
}

.notice-content ul, 
.ql-editor ul {
    display: block;
    list-style-type: disc;
    margin: 1em 0;
    padding-left: 40px;
}

.notice-content ol, 
.ql-editor ol {
    display: block;
    list-style-type: decimal;
    margin: 1em 0;
    padding-left: 40px;
}

.notice-content li, 
.ql-editor li {
    display: list-item;
}

.notice-content blockquote, 
.ql-editor blockquote {
    display: block;
    margin: 1em 40px;
    border-left: 3px solid #ccc;
    padding-left: 10px;
    color: #666;
}

.notice-content code, 
.ql-editor code {
    font-family: monospace;
    background-color: #f5f5f7;
    padding: 2px 4px;
    border-radius: 4px;
}

.notice-content pre, 
.ql-editor pre {
    font-family: monospace;
    background-color: #f5f5f7;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
}

.notice-content img, 
.ql-editor img {
    max-width: 100%;
    height: auto;
}

.notice-content table, 
.ql-editor table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.notice-content table td,
.notice-content table th,
.ql-editor table td,
.ql-editor table th {
    border: 1px solid #ddd;
    padding: 8px;
}

/* 첨부파일 영역 스타일 */
.notice-attachment {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.attachment-info {
    display: flex;
    align-items: center;
    background-color: #f9fafb;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.attachment-info i {
    margin-right: 8px;
    color: #4b5563;
}

/* Quill 에디터 툴바 일관성 개선 */
.ql-toolbar.ql-snow {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-color: #e5e7eb;
}

.ql-container.ql-snow {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    border-color: #e5e7eb;
}

/* Quill 에디터 크기 조절 기능 */
#quill-editor {
    height: 400px;
    min-height: 300px;
    resize: vertical;
    overflow: hidden;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* 크기 조절 핸들 표시를 위한 스타일 */
#quill-editor::after {
    content: "";
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 12px;
    height: 12px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="%23999"><path d="M22 22H2V2h20v20zM5 5v14h14V5H5z"/><path d="M16 16h2v2h-2zM11 16h2v2h-2zM6 16h2v2H6zM16 11h2v2h-2zM11 11h2v2h-2zM6 11h2v2H6zM16 6h2v2h-2zM11 6h2v2h-2zM6 6h2v2H6z"/></svg>');
    background-repeat: no-repeat;
    background-position: bottom right;
    pointer-events: none;
    opacity: 0.7;
} 