/**
 * HC Church Management - Frontend CSS
 * 
 * 교회 검색, 등록, 선택 기능의 스타일 정의
 */

/* 교회 검색 컨테이너 */
.hc-church-search-container {
    position: relative;
    margin-bottom: 20px;
}

.hc-church-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.hc-church-search-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* 검색 결과 컨테이너 */
.hc-church-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #e1e5e9;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

/* 검색 결과 아이템 */
.hc-church-search-result {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.hc-church-search-result:hover {
    background-color: #f8f9fa;
}

.hc-church-search-result:last-child {
    border-bottom: none;
}

.hc-church-search-result .hc-church-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 4px;
}

.hc-church-search-result .hc-church-info {
    display: flex;
    gap: 15px;
    margin-bottom: 4px;
    font-size: 14px;
    color: #666;
}

.hc-church-search-result .hc-denomination {
    color: #007cba;
    font-weight: 500;
}

.hc-church-search-result .hc-pastor {
    color: #666;
}

.hc-church-search-result .hc-church-address {
    font-size: 13px;
    color: #888;
    line-height: 1.4;
}

/* 검색 상태 메시지 */
.hc-search-loading,
.hc-search-error,
.hc-no-results {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.hc-search-error {
    color: #d63638;
}

/* 선택된 교회 정보 */
.hc-selected-church-info {
    margin: 20px 0;
    display: none;
}

.hc-selected-church {
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    position: relative;
}

.hc-selected-church .hc-church-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.hc-selected-church .hc-church-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.hc-change-church-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #007cba;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.hc-change-church-btn:hover {
    background: #005a87;
}

/* 교회 등록 폼 */
.hc-church-registration-form {
    background: #fff;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
}

.hc-church-registration-form h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.hc-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.hc-form-group {
    flex: 1;
}

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

.hc-form-group input,
.hc-form-group select,
.hc-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.hc-form-group input:focus,
.hc-form-group select:focus,
.hc-form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

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

.hc-required {
    color: #d63638;
}

.hc-other-denomination {
    display: none;
    margin-top: 10px;
}

/* 폼 메시지 */
.hc-form-message {
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.hc-form-message.hc-success {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.hc-form-message.hc-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 교회 선택 버튼 */
.hc-select-church-btn {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.hc-select-church-btn:hover {
    background: #005a87;
}

.hc-select-church-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 사용자 교회 정보 */
.hc-user-church-info {
    margin: 20px 0;
    display: none;
}

.hc-user-church {
    background: #fff;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    padding: 20px;
}

.hc-user-church h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.hc-church-details {
    margin-bottom: 15px;
}

.hc-church-details .hc-church-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.hc-church-details .hc-church-info {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.hc-church-details .hc-denomination {
    color: #007cba;
    font-weight: 500;
}

.hc-church-details .hc-pastor {
    color: #666;
}

.hc-church-details .hc-church-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.hc-church-details .hc-user-role {
    display: inline-block;
    background: #e7f3ff;
    color: #007cba;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* 메시지 컨테이너 */
.hc-message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.hc-message {
    background: #fff;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.hc-message.hc-success {
    border-color: #badbcc;
    background: #d1e7dd;
    color: #0f5132;
}

.hc-message.hc-error {
    border-color: #f5c6cb;
    background: #f8d7da;
    color: #721c24;
}

/* 숨겨진 필드 */
.hc-selected-church-id {
    display: none;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .hc-form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .hc-church-search-results {
        max-height: 250px;
    }
    
    .hc-church-registration-form {
        padding: 20px;
    }
    
    .hc-message-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}

/* 로딩 애니메이션 */
.hc-search-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 접근성 개선 */
.hc-church-search-result:focus {
    outline: 2px solid #007cba;
    outline-offset: -2px;
}

.hc-select-church-btn:focus,
.hc-change-church-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* 다크 모드 지원 */
@media (prefers-color-scheme: dark) {
    .hc-church-search-results,
    .hc-church-registration-form,
    .hc-user-church,
    .hc-selected-church {
        background: #2c3338;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .hc-church-search-input,
    .hc-form-group input,
    .hc-form-group select,
    .hc-form-group textarea {
        background: #2c3338;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .hc-church-search-result:hover {
        background-color: #374151;
    }
    
    .hc-selected-church {
        background: #374151;
    }
    
    .hc-message {
        background: #2c3338;
        border-color: #4a5568;
        color: #e2e8f0;
    }
}
