/* 전체 레이아웃 및 타이포그래피 */
body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin: 20px 0;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 네비게이션 바 개선 */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav .nav-link {
    color: #333 !important;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin: 0 5px;
    padding: 8px 16px !important;
}

.navbar-nav .nav-link:hover {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white !important;
    transform: translateY(-2px);
}

.navbar-text {
    color: #666 !important;
    font-weight: 500;
}

/* 카드 디자인 개선 */
.card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 20px;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

/* 썸네일 이미지 스타일 */
.post-card {
    transition: transform 0.2s ease-in-out;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.post-thumbnail {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 15px;
}

.thumbnail-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.post-thumbnail:hover .thumbnail-img {
    transform: scale(1.05);
}

.no-thumbnail {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.post-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
}

.post-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* 버튼 스타일 개선 */
.btn {
    border-radius: 25px;
    font-weight: 600;
    padding: 12px 30px;
    transition: all 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(45deg, #5a6fd8, #6a42a0);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    background: transparent;
}

.btn-outline-primary:hover {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(45deg, #56ab2f, #a8e6cf);
    box-shadow: 0 4px 15px rgba(86, 171, 47, 0.4);
}

.btn-danger {
    background: linear-gradient(45deg, #ff416c, #ff4b2b);
    box-shadow: 0 4px 15px rgba(255, 65, 108, 0.4);
}

.btn-secondary {
    background: linear-gradient(45deg, #bdc3c7, #2c3e50);
    box-shadow: 0 4px 15px rgba(189, 195, 199, 0.4);
}

/* 폼 요소 개선 */
.form-control {
    border-radius: 15px;
    border: 2px solid #e9ecef;
    padding: 15px 20px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: white;
    transform: translateY(-2px);
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

/* 알림 메시지 개선 */
.alert {
    border-radius: 15px;
    border: none;
    padding: 20px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.alert-success {
    background: linear-gradient(45deg, rgba(86, 171, 47, 0.1), rgba(168, 230, 207, 0.1));
    color: #2d5a3d;
    border-left: 4px solid #56ab2f;
}

.alert-danger {
    background: linear-gradient(45deg, rgba(255, 65, 108, 0.1), rgba(255, 75, 43, 0.1));
    color: #721c24;
    border-left: 4px solid #ff416c;
}

.alert-info {
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    color: #0c5460;
    border-left: 4px solid #667eea;
}

/* 블로그 헤더 스타일 */
.blog-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.blog-header h1 {
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
    margin-bottom: 15px;
}

/* 댓글 섹션 개선 */
.comment-section {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-top: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.comment {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.comment:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* 페이지네이션 개선 */
.pagination .page-link {
    border-radius: 10px;
    margin: 0 5px;
    border: none;
    color: #667eea;
    font-weight: 600;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-color: transparent;
}

/* 통계 카드 */
.stats-card {
    text-align: center;
    padding: 20px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .main-content {
        margin: 10px;
        padding: 20px;
        border-radius: 15px;
    }
    
    .blog-header {
        padding: 25px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

/* 애니메이션 효과 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 로딩 애니메이션 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 스크롤바 스타일링 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #5a6fd8, #6a42a0);
}

/* CKEditor 5 커스텀 스타일 */
.ck-editor__editable {
    min-height: 400px;
    border-radius: 8px;
}

.ck-editor__main {
    border-radius: 8px;
}

.ck-toolbar {
    border-radius: 8px 8px 0 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.ck-toolbar .ck-button {
    color: white;
}

.ck-toolbar .ck-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.ck-toolbar .ck-button.ck-on {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.ck-content {
    font-family: 'Noto Sans KR', sans-serif;
    line-height: 1.6;
}

.ck-content h1, .ck-content h2, .ck-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.ck-content p {
    margin-bottom: 1em;
}

.ck-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1em;
    margin: 1em 0;
    font-style: italic;
    background: rgba(102, 126, 234, 0.05);
}

.ck-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.ck-content table td, .ck-content table th {
    border: 1px solid #ddd;
    padding: 8px;
}

.ck-content table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

/* 에디터 모드 선택기 스타일 */
.editor-mode-selector {
    margin-bottom: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

.editor-mode-selector label {
    margin-right: 1rem;
    margin-bottom: 0;
    font-weight: normal;
}

.editor-mode-selector input[type="radio"] {
    margin-right: 0.5rem;
}

/* HTML 에디터 컨테이너 */
.html-editor-container {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

/* HTML 에디터 탭 */
.html-editor-tabs {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.html-editor-tab {
    padding: 0.75rem 1rem;
    border: none;
    background-color: transparent;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.html-editor-tab:hover {
    background-color: #e9ecef;
}

.html-editor-tab.active {
    background-color: #fff;
    border-bottom-color: #007bff;
    font-weight: 600;
}

/* HTML 에디터 내용 */
.html-editor-content {
    position: relative;
    min-height: 400px;
}

.html-code-editor {
    width: 100%;
    height: 400px;
    border: none;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

.html-preview {
    padding: 1rem;
    min-height: 400px;
    background-color: #fff;
    overflow-y: auto;
    border: none;
}

/* CKEditor 컨테이너 */
#wysiwyg-editor .ck-editor {
    border-radius: 0.375rem;
}

#wysiwyg-editor .ck-editor__editable {
    min-height: 400px;
}

/* 가로 레이아웃을 위한 게시물 카드 스타일 */
.post-card-horizontal {
    display: flex;
    align-items: stretch;
    min-height: 200px;
}

.post-thumbnail-horizontal {
    flex: 0 0 300px;
    position: relative;
    overflow: hidden;
    border-radius: 8px 0 0 8px;
}

.post-thumbnail-horizontal .thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-thumbnail-horizontal:hover .thumbnail-img {
    transform: scale(1.05);
}

.no-thumbnail-horizontal {
    flex: 0 0 300px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    border-radius: 8px 0 0 8px;
    flex-direction: column;
}

.post-content-horizontal {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

.post-content-horizontal .card-title {
    margin-bottom: 10px;
    font-size: 1.25rem;
    font-weight: 600;
}

.post-content-horizontal .post-meta {
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.post-content-horizontal .card-text {
    flex: 1;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .post-card-horizontal {
        flex-direction: column;
    }
    
    .post-thumbnail-horizontal {
        flex: none;
        height: 200px;
        border-radius: 8px 8px 0 0;
    }
    
    .no-thumbnail-horizontal {
        flex: none;
        height: 200px;
        border-radius: 8px 8px 0 0;
    }
    
    .post-content-horizontal {
        padding: 15px;
    }
}