/* ==========================================================================
   공통 컴포넌트 스타일
   ========================================================================== */

/* Breadcrumb 컴포넌트 */
.breadcrumb {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

/* 카드 컴포넌트 개선 */
.card {
    border-radius: 0.5rem;
}

.card-header {
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

/* 폼 컴포넌트 */
.form-label {
    color: #495057;
    font-weight: 600;
}

.btn {
    border-radius: 0.375rem;
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

/* 업로드 컴포넌트 */
.upload-zone {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
}

.upload-zone:hover {
    border-color: var(--primary-color) !important;
    background-color: #f0f4f8 !important;
}

.upload-zone.dragover {
    border-color: var(--primary-color);
    background-color: #e3f2fd;
}

/* 이미지 미리보기 */
.image-preview {
    display: inline-block;
    margin: 5px;
    position: relative;
}

.image-preview img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0.25rem;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

.image-preview:hover img {
    border-color: var(--primary-color);
}

.image-preview .remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.image-preview .remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* 모바일 메타 정보 */
.mobile-meta-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-meta-item {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.mobile-meta-item i {
    width: 16px;
    text-align: center;
    color: var(--primary-color);
}

.mobile-action-buttons {
    text-align: center;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
}

/* 컨텐츠 영역 - 기본 스타일 */
.content {
    line-height: 1.8;
    margin-top: 1rem;
}

/* ==========================================================================
   콘텐츠 영역 이미지 반응형 처리 (사용자 페이지용)
   ========================================================================== */

/* 콘텐츠 영역 기본 설정 */
.post-content,
.content,
.page-content,
.gallery-description {
    overflow: hidden;
    word-wrap: break-word;
}

/* 모든 콘텐츠 영역 내 이미지 반응형 처리 */
.post-content img,
.content img,
.page-content img,
.gallery-description img {
    max-width: 100% !important;
    height: auto !important;
    width: auto;
    margin: 0.5rem 0;
    border-radius: 0.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 테이블 내 이미지 처리 */
.post-content table img,
.content table img,
.page-content table img,
.gallery-description table img {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
}

/* 비디오, iframe 등 미디어 요소 반응형 처리 */
.post-content video,
.post-content iframe,
.post-content embed,
.post-content object,
.content video,
.content iframe,
.content embed,
.content object,
.page-content video,
.page-content iframe,
.page-content embed,
.page-content object,
.gallery-description video,
.gallery-description iframe,
.gallery-description embed,
.gallery-description object {
    max-width: 100% !important;
    height: auto !important;
}

/* 테이블 반응형 처리 */
.post-content table,
.content table,
.page-content table,
.gallery-description table {
    width: 100%;
    table-layout: auto;
    overflow-x: auto;
}

/* 빈 상태 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

/* 로딩 상태 */
.loading {
    display: inline-block;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 갤러리 컴포넌트 */
.object-cover {
    object-fit: cover;
}

.gallery-card {
    transition: all 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

.gallery-overlay {
    transition: all 0.3s ease;
    opacity: 0.9;
}

.gallery-card:hover .gallery-overlay {
    opacity: 1;
}

.text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    font-weight: 500;
}

/* 사이드바 컴포넌트 */
.sidebar-container {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-container:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sidebar-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f1f3f4;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

.sidebar-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: -0.02em;
}

.sidebar-title i {
    color: #6c7b7f;
    font-size: 14px;
}

.sidebar-menu {
    padding: 8px 0;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    margin: 2px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.menu-item-content {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    flex: 1;
    z-index: 2;
    position: relative;
}

.menu-icon {
    width: 16px;
    margin-right: 12px;
    color: #8e9aaf;
    font-size: 14px;
}

.menu-text {
    flex: 1;
    line-height: 1.4;
}

.menu-indicator {
    width: 3px;
    height: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: height 0.3s ease;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.sidebar-menu-item:hover {
    background: linear-gradient(135deg, #f7f9fc 0%, #eef2f7 100%);
    color: #2d3748;
    transform: translateX(2px);
}

.sidebar-menu-item:hover .menu-icon {
    color: #667eea;
}

.sidebar-menu-item:hover .menu-indicator {
    height: 20px;
}

.sidebar-menu-item.active {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    color: #1565c0;
    font-weight: 600;
}

.sidebar-menu-item.active .menu-icon {
    color: #1976d2;
}

.sidebar-menu-item.active .menu-indicator {
    height: 24px;
    background: linear-gradient(135deg, #1976d2 0%, #7b1fa2 100%);
}

.sidebar-menu-item.active:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    color: #1565c0;
    transform: translateX(0);
}

.sidebar-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    color: #8e9aaf;
    font-size: 14px;
    text-align: center;
}

.sidebar-empty i {
    color: #bbb;
}

/* 모바일 메뉴 스타일 */
.mobile-menu-container {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.mobile-menu-toggle {
    background: transparent;
    border: none;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    text-align: left;
    transition: all 0.2s ease;
}

.mobile-menu-toggle:focus {
    box-shadow: none;
    background: transparent;
}

.mobile-menu-toggle:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.mobile-menu-toggle .toggle-icon {
    font-size: 12px;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.mobile-menu-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.mobile-menu-title {
    color: #2c3e50;
    font-weight: 600;
}

.mobile-menu-content {
    border-top: 1px solid #f1f3f4;
    background: #fafbfc;
    padding: 8px 0;
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    margin: 2px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: #4a5568;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-menu-item:hover {
    background: #ffffff;
    color: #2d3748;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.mobile-menu-item.active {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    color: #1565c0;
    font-weight: 600;
}

.mobile-menu-item.active i {
    color: #1976d2;
}

.mobile-menu-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #8e9aaf;
    font-size: 14px;
    text-align: center;
}

/* 사이드바 반응형 조정 */
@media (max-width: 1199.98px) {
    .sidebar-header {
        padding: 16px 20px 14px;
    }
    
    .sidebar-title {
        font-size: 15px;
    }
    
    .menu-item-content {
        padding: 12px 14px;
    }
    
    .menu-text {
        font-size: 13px;
    }
}

/* 다크모드 대응 (선택사항) */
@media (prefers-color-scheme: dark) {
    .sidebar-container {
        background: #1e293b;
        border-color: #334155;
    }
    
    .sidebar-header {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        border-color: #475569;
    }
    
    .sidebar-title {
        color: #e2e8f0;
    }
    
    .sidebar-menu-item {
        color: #cbd5e1;
    }
    
    .sidebar-menu-item:hover {
        background: linear-gradient(135deg, #334155 0%, #475569 100%);
        color: #f1f5f9;
    }
    
    .sidebar-menu-item.active {
        background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
        color: #ffffff;
    }
}

/* 모바일 최적화 */
/* 모바일에서 콘텐츠 영역 개선 */
@media (max-width: 768px) {
    .post-content,
    .content,
    .page-content,
    .gallery-description {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .post-content img,
    .content img,
    .page-content img,
    .gallery-description img {
        margin: 0.25rem 0;
    }
    
    .post-content table,
    .content table,
    .page-content table,
    .gallery-description table {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .mobile-meta-info {
        gap: 0.4rem;
    }
    
    .mobile-meta-item {
        font-size: 0.85rem;
    }
    
    .image-preview img {
        width: 80px;
        height: 80px;
    }
    
    .upload-zone {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
} 