/* 공통 모달 스타일 - CRUD 기능용 */

/* CRUD 전용 모달 백드롭 */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001 !important;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* CRUD 전용 모달 - 회원 상세 모달과 구분 */
.modal-backdrop > .modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    position: relative;
    z-index: 10002 !important;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 모달 헤더 - CRUD 전용 */
.modal-backdrop .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.modal-backdrop .modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-backdrop .btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--gray-500);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
}

.modal-backdrop .btn-close:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

/* 모달 바디 - CRUD 전용 */
.modal-backdrop .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* 모달 푸터 - CRUD 전용 */
.modal-backdrop .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-shrink: 0;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.form-input[readonly] {
    background: var(--gray-50);
    cursor: not-allowed;
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* 2열 폼 레이아웃 */
.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row-2col:last-child {
    margin-bottom: 0;
}

/* 버튼 스타일 */
.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;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-500);
}

.empty-state i {
    font-size: 48px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Link Selection List */
.link-selection-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-item-card {
    padding: 14px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.link-item-card:hover {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.link-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 6px;
}

.link-item-meta {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--gray-600);
    align-items: center;
}

.link-item-meta i {
    margin-right: 4px;
    color: var(--gray-500);
}

.link-item-meta .item-badge {
    padding: 2px 8px;
    background: var(--gray-200);
    color: var(--gray-700);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* 반응형 - 모바일 */
@media (max-width: 768px) {
    .modal-backdrop {
        padding: 0;
    }
    
    .modal-backdrop > .modal {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .modal-backdrop .modal-body {
        padding: 16px;
    }
    
    .modal-backdrop .modal-footer {
        padding: 12px 16px;
    }
    
    .form-row-2col {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* 반응형 - 작은 화면 */
@media (max-width: 480px) {
    .modal-backdrop .modal-header {
        padding: 16px;
    }
    
    .modal-backdrop .modal-header h3 {
        font-size: 16px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .form-input,
    .form-select {
        font-size: 13px;
        padding: 8px 10px;
    }
}
