/**
 * 공통 스타일
 * 전역 스타일 및 유틸리티 클래스
 */

/* 폰트 설정 */
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 기본 포커스 스타일 */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid #94a3b8;
    outline-offset: 2px;
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 폼 요소 기본 스타일 */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 0.375rem;
}

.form-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: #1e293b;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.1);
}

.form-input::placeholder {
    color: #94a3b8;
}

.form-input:disabled {
    background-color: #f8fafc;
    cursor: not-allowed;
}

/* 텍스트영역 */
.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* 셀렉트 박스 */
.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* 버튼 기본 스타일 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

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

.btn-primary {
    color: #fff;
    background-color: #334155;
    border: none;
}

.btn-primary:hover:not(:disabled) {
    background-color: #1e293b;
}

.btn-secondary {
    color: #475569;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #e2e8f0;
}

.btn-danger {
    color: #be123c;
    background-color: #ffe4e6;
    border: none;
}

.btn-danger:hover:not(:disabled) {
    background-color: #fecdd3;
}

/* 뱃지 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
}

.badge-success {
    color: #047857;
    background-color: #d1fae5;
}

.badge-warning {
    color: #b45309;
    background-color: #fef3c7;
}

.badge-danger {
    color: #be123c;
    background-color: #ffe4e6;
}

.badge-default {
    color: #64748b;
    background-color: #f1f5f9;
}

/* 카드 */
.card {
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-body {
    padding: 1.5rem;
}

/* 테이블 */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    font-size: 0.875rem;
    border-collapse: collapse;
}

.data-table thead {
    background-color: #f8fafc;
}

.data-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 500;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 0.75rem 1rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

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

/* 알림 메시지 */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.alert-success {
    color: #047857;
    background-color: #d1fae5;
}

.alert-warning {
    color: #b45309;
    background-color: #fef3c7;
}

.alert-danger {
    color: #be123c;
    background-color: #ffe4e6;
}

.alert-info {
    color: #0369a1;
    background-color: #e0f2fe;
}

/* 로딩 스피너 */
.spinner {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e2e8f0;
    border-top-color: #334155;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 페이지네이션 */
.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #475569;
    border-radius: 0.25rem;
    cursor: pointer;
}

.pagination-item:hover {
    background-color: #f1f5f9;
}

.pagination-item.active {
    color: #fff;
    background-color: #334155;
}

.pagination-item.disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

/* 유틸리티 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 문서 카드 */
.doc-card {
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow: hidden;
    transition: box-shadow 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.doc-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.doc-card-body {
    flex: 1;
    padding: 1.25rem;
}

.doc-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.doc-card-description {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-card-meta {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: #94a3b8;
}

.doc-card-meta-divider {
    width: 1px;
    height: 12px;
    background-color: #e2e8f0;
    margin: 0 0.5rem;
}

.doc-card-footer {
    padding: 1rem 1.25rem;
    background-color: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.doc-view-btn {
    display: block;
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background-color: #334155;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease-in-out;
}

.doc-view-btn:hover {
    background-color: #1e293b;
}
