/* running-tips.css - 러닝 팁 페이지 스타일 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: white;
    padding-top: 0;
    padding-bottom: 35px;
}


/* ============== 페이지 타이틀 섹션 ============== */

.page-title-section {
    background: white;
    padding: 8px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.title-container h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.title-container p {
    color: #666;
    font-size: 0.95rem;
}

.admin-add-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.admin-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}


/* ============== 카테고리 필터 ============== */

.filter-section {
    background: white;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-label {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
    white-space: nowrap;
}

.category-select {
    flex: 1;
    max-width: 300px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.category-select:focus {
    outline: none;
    border-color: #667eea;
}

.category-select:hover {
    border-color: #667eea;
}


/* ============== 팁 리스트 ============== */

.tips-list-section {
    background: white;
    padding: 0;
    margin-top: 0;
}

.tips-list-container {
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}


/* ============== 팁 아이템 ============== */

.tip-item {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: background 0.3s;
    position: relative;
}

.tip-item:hover {
    background: #f9f9f9;
}

.tip-item:last-child {
    border-bottom: none;
}

.tip-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tip-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    margin: 0;
}

.tip-category-badge {
    padding: 1px 6px;
    background: #f0f0f0;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.tip-preview {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    white-space: pre-wrap;
}


/* ============== 관리자 액션 ============== */

.admin-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.admin-edit-btn,
.admin-delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.admin-edit-btn {
    background: #f0f0f0;
    color: #667eea;
}

.admin-edit-btn:hover {
    background: #667eea;
    color: white;
}

.admin-delete-btn {
    background: #ffe0e0;
    color: #ff4444;
}

.admin-delete-btn:hover {
    background: #ff4444;
    color: white;
}


/* ============== 로딩 및 빈 상태 ============== */

.loading-state,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}


/* ============== 모달 ============== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 24px;
    border-bottom: 2px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.4rem;
    color: #333;
}

.modal-close-btn {
    width: 36px;
    height: 36px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-close-btn:hover {
    background: #e0e0e0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 2px solid #f0f0f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}


/* ============== 폼 스타일 ============== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
    line-height: 1.6;
}

.category-input-group {
    display: flex;
    gap: 8px;
}

.category-input-group select {
    flex: 1;
}

.add-category-btn {
    padding: 12px 16px;
    background: #f0f0f0;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.add-category-btn:hover {
    background: #667eea;
    color: white;
}

#newCategoryInput {
    display: flex;
    gap: 8px;
}

#newCategoryInput input {
    flex: 1;
}

.save-category-btn,
.cancel-category-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.save-category-btn {
    background: #667eea;
    color: white;
}

.save-category-btn:hover {
    background: #5568d3;
}

.cancel-category-btn {
    background: #f0f0f0;
    color: #666;
}

.cancel-category-btn:hover {
    background: #e0e0e0;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.btn-cancel,
.btn-submit,
.btn-delete {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-delete {
    background: #ff4444;
    color: white;
}

.btn-delete:hover {
    background: #cc0000;
}


/* ============== 상세보기 스타일 ============== */

.detail-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.detail-category {
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.detail-content {
    line-height: 1.8;
    color: #333;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-break: break-word;
}


/* ============== 페이지네이션 ============== */

#paginationContainer {
    margin-top: 0;
    margin-bottom: 0;
    padding: 15px 20px 6px 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) {
    .page-title-section {
        padding: 20px;
    }
    .title-container h1 {
        font-size: 1.5rem;
    }
    .admin-add-btn {
        width: 100%;
        margin-top: 10px;
    }
    .filter-container {
        flex-direction: column;
        align-items: stretch;
    }
    .category-select {
        max-width: none;
    }
    .tip-header {
        flex-direction: row;
        align-items: center;
    }
    .tip-title {
        font-size: 0.95rem;
    }
    .modal-content {
        max-width: 95%;
    }
    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    #paginationContainer {
        padding: 12px 20px 5px 20px;
    }
}

.modal-small .modal-content {
    max-width: 400px;
}


/* ============== 관리자 버튼 ============== */

.admin-manage-btn {
    padding: 10px 20px;
    background: #f0f0f0;
    color: #667eea;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    margin-left: 10px;
}

.admin-manage-btn:hover {
    background: #667eea;
    color: white;
}


/* ============== 카테고리 관리 ============== */

.category-manage-section {
    margin-bottom: 30px;
}

.category-manage-section h3,
.category-add-section h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.category-manage-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-manage-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s;
}

.category-manage-item:hover {
    border-color: #667eea;
    background: #f5f7ff;
}

.category-manage-name {
    font-weight: 600;
    color: #333;
    flex: 1;
}

.category-manage-count {
    color: #999;
    font-size: 0.9rem;
    margin-right: 15px;
}

.category-delete-btn {
    padding: 6px 12px;
    background: #ffe0e0;
    color: #ff4444;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.category-delete-btn:hover {
    background: #ff4444;
    color: white;
}

.category-delete-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.category-add-section {
    margin-top: 30px;
}

.category-add-form {
    display: flex;
    gap: 10px;
}

.category-add-form input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
}

.category-add-form input:focus {
    outline: none;
    border-color: #667eea;
}

.category-add-form button {
    padding: 12px 24px;
    white-space: nowrap;
}