/* API 정의서 관리 페이지 스타일 */
/* 기존 관리자 페이지 표준 스타일 준수 */

/* 페이지 헤더 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.page-header .header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.page-header #addAPIBtn,
.page-header #autoExtractBtn,
.page-header #exportBtn {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    flex-shrink: 0;
}

/* 요약 정보 카드 */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-card .card-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.summary-card .card-value {
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
}

.summary-card .card-subtitle {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    line-height: 1.5;
}

.summary-inline-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: -8px 0 24px;
}

.summary-inline-metrics .inline-metric {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    color: #4b5563;
}

.summary-inline-metrics .inline-metric strong {
    color: #111827;
    margin-left: 6px;
}

/* 검색 및 필터 영역 */
.search-filter-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.search-box .btn {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-toggle {
    margin-bottom: 12px;
}

.filter-toggle .btn-link {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 0;
}

.filter-toggle .btn-link:hover {
    text-decoration: underline;
}

.advanced-filter {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-select:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}

.search-result-summary {
    margin-top: 12px;
    font-size: 13px;
    color: #555;
    text-align: right;
}

/* 테이블 */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    margin-bottom: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

.logical-key-cell {
    min-width: 260px;
}

.logical-key-value {
    color: #333;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    word-break: break-all;
}

.logical-key-reason {
    color: #667eea;
    font-size: 11px;
    margin-top: 4px;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table .loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 상태 배지 */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* 액션 버튼 */
.action-buttons {
    display: flex;
    gap: 8px;
}

.action-buttons .btn {
    padding: 4px 8px;
    font-size: 12px;
    width: auto;
}

/* 페이지네이션 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.page-size-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.pagination {
    display: flex;
    gap: 8px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.pagination button:hover:not(:disabled) {
    background: #f8f9fa;
}

.pagination button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 모달 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-large {
    max-width: 1000px;
}

.modal-small {
    max-width: 500px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.table-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    margin-bottom: 24px;
}

.export-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.export-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.export-option:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

.export-option input[type="radio"] {
    width: auto;
    margin: 0;
}

/* 확인 모달 스타일 (글로벌 표준) */
.modal-confirm {
    max-width: 500px;
}

.confirm-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.confirm-icon svg {
    width: 48px;
    height: 48px;
}

.confirm-message {
    text-align: center;
}

.confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.confirm-username {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 16px;
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 6px;
    display: inline-block;
}

.confirm-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 16px;
    margin-top: 16px;
    text-align: left;
}

.confirm-info p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.confirm-info p:first-child {
    margin-top: 0;
}

.confirm-info p:last-child {
    margin-bottom: 0;
}

.method-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.method-badge.method-get {
    background: #d4edda;
    color: #155724;
}

.method-badge.method-post {
    background: #d1ecf1;
    color: #0c5460;
}

.method-badge.method-put {
    background: #fff3cd;
    color: #856404;
}

.method-badge.method-delete {
    background: #f8d7da;
    color: #721c24;
}

.method-badge.method-patch {
    background: #e2e3e5;
    color: #383d41;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

/* 모달 하단 버튼 - 표준 크기 */
.modal-footer .btn {
    width: auto;
    min-width: 96px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.modal-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.modal-footer .btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.form-group .required {
    color: #dc3545;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #999;
}

.form-hint.edit-mode-hint {
    color: #ff9800;
}

.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button input {
    flex: 1;
}

/* 자동 생성 코드 입력 필드 스타일 */
.input-with-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.input-with-badge input {
    flex: 1;
}

.auto-generated-input {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #666;
}

.auto-generated-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-icon {
    font-size: 14px;
}

.btn-small {
    padding: 8px 12px;
    font-size: 12px;
    width: auto;
    flex-shrink: 0;
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: white;
}

.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 버튼 스타일 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-search {
    background: #28a745;
    color: white;
}

.btn-search:hover {
    background: #218838;
}

/* 토스트 메시지 */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: #333;
    color: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 2000;
    max-width: 400px;
}

.toast.show {
    display: block;
    animation: slideIn 0.3s ease-out;
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 필드 도움말 및 가이드 */
.field-help {
    display: inline-block;
    margin-left: 4px;
    cursor: help;
    color: #6c757d;
    font-size: 14px;
    vertical-align: middle;
}

.field-help:hover {
    color: #0056b3;
}

.field-required {
    color: #dc3545;
    margin-left: 4px;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

.char-counter span {
    font-weight: 600;
}

.field-guide {
    margin-top: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-left: 3px solid #0056b3;
    border-radius: 4px;
    font-size: 13px;
}

.field-guide strong {
    display: block;
    margin-bottom: 8px;
    color: #0056b3;
}

.field-guide ul {
    margin: 0;
    padding-left: 20px;
    color: #495057;
}

.field-guide li {
    margin-bottom: 4px;
    line-height: 1.5;
}

/* textarea 스타일 개선 */
textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.5;
}

textarea:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .pagination-container {
        flex-direction: column;
        gap: 16px;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
}
