/* 러닝 뉴스 페이지 전용 스타일 */


/* ============== 페이지 타이틀 섹션 ============== */

.page-title-section {
    background: white;
    padding: 24px 20px;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
}

.title-container h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.title-container p {
    font-size: 0.95rem;
    color: #666;
}


/* 관리자 전용 등록 버튼 */

.admin-add-btn {
    position: absolute;
    top: 24px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.admin-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.admin-add-btn:active {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .admin-add-btn {
        position: static;
        margin-top: 16px;
        width: 100%;
    }
}


/* ============== 뉴스 리스트 섹션 ============== */

.news-list-section {
    background: white;
    padding: 0;
    margin-top: 0;
}

.news-list-container {
    padding: 0;
}


/* ============== 뉴스 아이템 ============== */

.news-item {
    display: flex;
    gap: 15px;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.news-item:hover {
    background: #f8f9fa;
}

.news-item:active {
    background: #f0f0f0;
}

.news-item:last-child {
    border-bottom: none;
}


/* 썸네일 이미지 */

.news-thumbnail {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}


/* 뉴스 콘텐츠 */

.news-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.news-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.news-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 0.8rem;
    color: #999;
    margin-bottom: 8px;
}

.news-date {
    color: #999;
}

.news-description {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    white-space: pre-wrap;
    /* 줄바꿈 적용 */
}


/* ============== 관리자 액션 버튼 ============== */

.admin-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.admin-edit-btn,
.admin-delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.admin-edit-btn {
    background: #e3f2fd;
    color: #1976d2;
}

.admin-edit-btn:hover {
    background: #bbdefb;
}

.admin-delete-btn {
    background: #ffebee;
    color: #c62828;
}

.admin-delete-btn:hover {
    background: #ffcdd2;
}


/* ============== 로딩 & 빈 상태 ============== */

.loading-state,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.loading-state {
    font-size: 1.2rem;
}

.empty-state {
    font-size: 1rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}


/* ============== 모달 스타일 ============== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
}

.btn-cancel,
.btn-submit,
.btn-delete {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-delete {
    background: #ffebee;
    color: #c62828;
}

.btn-delete:hover {
    background: #ffcdd2;
}


/* ============== 뉴스 상세 모달 ============== */

.modal-detail {
    max-width: 600px;
}

.modal-body {
    padding: 30px;
}

.detail-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
}

.detail-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.detail-date {
    color: #999;
    font-size: 0.9rem;
}

.detail-description {
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
    white-space: pre-wrap;
    /* 줄바꿈 적용 */
    word-break: break-word;
}

.modal-small {
    max-width: 400px;
}


/* ============== 모바일 반응형 ============== */

@media (max-width: 480px) {
    .page-title-section {
        padding: 20px 16px;
    }
    .title-container h1 {
        font-size: 1.5rem;
    }
    .news-item {
        padding: 16px;
    }
    .news-thumbnail {
        width: 80px;
        height: 80px;
    }
    .news-title {
        font-size: 0.9rem;
    }
    .form-actions {
        flex-direction: column;
    }
    .modal-form {
        padding: 20px;
    }
}


/* ============== 이미지 크롭 모달 ============== */

.crop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
}

.crop-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.crop-modal-header {
    padding: 20px 30px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crop-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.crop-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.crop-close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.crop-modal-body {
    padding: 30px;
}

.crop-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    background: #f0f0f0;
    border-radius: 12px;
    padding: 20px;
}

#cropCanvas {
    display: block;
    max-width: 100%;
    cursor: move;
    border-radius: 8px;
}

.crop-controls {
    margin: 20px 0;
}

.crop-control-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.zoom-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.zoom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.crop-preview-section {
    text-align: center;
    margin-top: 30px;
}

#previewCanvas {
    display: inline-block;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
}

.crop-preview-hint {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

.crop-modal-footer {
    padding: 20px 30px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 12px;
}

.crop-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.crop-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.crop-btn-cancel:hover {
    background: #e0e0e0;
}

.crop-btn-apply {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.crop-btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

@media (max-width: 768px) {
    .crop-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    .crop-modal-body {
        padding: 20px;
    }
    .crop-modal-footer {
        flex-direction: column;
    }
}


/* ============== 페이지네이션 ============== */

#paginationContainer {
    margin-top: 0;
    margin-bottom: 0;
    padding: 30px 20px 30px 20px;
    /* 상하 여백 줄임 */
    background: white;
    /* 흰색 배경 추가 */
    border-top: 1px solid #e0e0e0;
    /* 상단 구분선 추가 */
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #333;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(.pagination-disabled):not(.pagination-active) {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.pagination-active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    cursor: default;
}

.pagination-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-dots {
    color: #999;
    padding: 0 4px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    #paginationContainer {
        padding: 25px 20px 25px 20px;
        /* 모바일 상하 여백 줄임 */
    }
}