/* 온라인 추모관 스타일 */

/* CSS 변수 정의 - 사용자 설정 색상 */
:root {
    --memorial-primary-color: #8B4513;
    --memorial-primary-hover-color: #A0522D;
    --memorial-secondary-color: #f8f8f8;
    --memorial-text-color: #333333;
    --memorial-border-color: #e0e0e0;
}

/* 검색 폼 스타일 */
.memorial-search-form {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.memorial-search-form h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.memorial-search-input-group {
    display: flex;
    gap: 10px;
}

.memorial-search-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.memorial-search-button {
    padding: 12px 24px;
    background: var(--memorial-primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.memorial-search-button:hover {
    background: var(--memorial-primary-hover-color);
}

/* 검색 결과 스타일 */
.memorial-search-results {
    margin-top: 30px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.memorial-search-results h3 {
    color: var(--memorial-primary-color);
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--memorial-primary-color);
}

.memorial-list {
    display: grid;
    gap: 15px;
    max-height: calc(200px * 3 + 30px); /* 3개 항목 높이 + 갭 */
    overflow-y: auto;
    padding-right: 10px;
    margin-right: -10px;
}

/* 스크롤바 스타일링 */
.memorial-list::-webkit-scrollbar {
    width: 8px;
}

.memorial-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.memorial-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.memorial-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.memorial-item {
    background: var(--memorial-secondary-color);
    padding: 20px;
    border-radius: 5px;
    border: 1px solid var(--memorial-border-color);
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.memorial-item:hover {
    background: #f0f0f0;
    border-color: var(--memorial-primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* 고인 사진 영역 */
.memorial-item-photo {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.memorial-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
    /* 이미지 로드 성능 최적화 */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* 이미지 로딩 중 스타일 */
    opacity: 0;
    animation: fadeIn 0.3s ease-in-out forwards;
}

/* 이미지 로딩 애니메이션 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 이미지 로딩 실패 시 스타일 */
.memorial-photo[src=""],
.memorial-photo:not([src]) {
    display: none;
}

.memorial-item:hover .memorial-photo {
    transform: scale(1.05);
}

.memorial-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
    color: #999;
    border-radius: 8px;
}

.memorial-photo-placeholder svg {
    opacity: 0.6;
}

.memorial-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.memorial-item h4 {
    margin: 0 0 10px 0;
    color: var(--memorial-text-color);
    font-size: 18px;
    font-weight: bold;
}

.memorial-item-actions {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    padding-top: 5px;
}

.memorial-visit-btn {
    background: var(--memorial-primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
    white-space: nowrap;
}

.memorial-visit-btn:hover {
    background: var(--memorial-primary-hover-color);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.3);
}

.memorial-meta {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.memorial-meta p {
    margin: 5px 0;
    display: flex;
    align-items: flex-start;
}

.memorial-meta strong {
    min-width: 80px;
    color: #333;
    font-weight: bold;
    margin-right: 8px;
}

/* 빈소 이용 현황 테이블 스타일 */
.funeral-hall-status {
    margin: 20px 0;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.funeral-hall-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
}

.funeral-hall-table th {
    background: #f5f5f5;
    color: #333;
    padding: 15px 8px;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

.funeral-hall-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    color: #555;
    vertical-align: middle;
    word-wrap: break-word;
}

.funeral-hall-table tr:hover {
    background: #f9f9f9;
    transition: background 0.3s;
}

.funeral-hall-table tr:last-child td {
    border-bottom: none;
}

.funeral-hall-table .button {
    background: var(--memorial-primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s;
}

.funeral-hall-table .button:hover {
    background: var(--memorial-primary-hover-color);
    color: white;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .memorial-search-form {
        margin: 10px;
        padding: 15px;
    }
    
    .memorial-search-input-group {
        flex-direction: column;
    }
    
    .funeral-hall-table {
        font-size: 14px;
    }
    
    .memorial-list {
        max-height: calc(200px * 1.5 + 70px); /* 모바일에서는 1.5개 항목 높이 (1개 완전히 보임) */
    }
    
    .funeral-hall-table th,
    .funeral-hall-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .funeral-hall-table th:nth-child(3),
    .funeral-hall-table td:nth-child(3) {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .funeral-hall-table th:nth-child(4),
    .funeral-hall-table td:nth-child(4) {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .funeral-hall-table .button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .memorial-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .memorial-item-photo {
        width: 100px;
        height: 100px;
        margin: 0 auto;
    }
    
    .memorial-item-content {
        gap: 10px;
    }
    
    .memorial-item-actions {
        align-self: stretch;
        justify-content: center;
    }
    
    .memorial-visit-btn {
        width: 100%;
        text-align: center;
    }
}

/* 로딩 스타일 */
.memorial-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* 빈 결과 스타일 */
.memorial-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.memorial-no-results p {
    font-size: 18px;
    margin: 0;
    color: #8B4513;
    font-weight: 500;
}

/* 위젯 스타일 */
.widget_funeral_hall_status_widget {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.widget_funeral_hall_status_widget h3 {
    color: #8B4513;
    margin-bottom: 15px;
    border-bottom: 2px solid #8B4513;
    padding-bottom: 10px;
}

/* Melorial 단일 포스트 스타일 - 예시 페이지 기반 디자인 */
.memorial-single {
    min-height: 100vh;
    background: #f5f5f5;
    background-image: 
        radial-gradient(circle at 1px 1px, rgba(0,0,0,0.03) 1px, transparent 0);
    background-size: 20px 20px;
    padding: 40px 20px;
    font-family: 'Malgun Gothic', '맑은 고딕', sans-serif;
}

.memorial-card {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    position: relative;
}

.memorial-header {
    background: #8B4513;
    color: white;
    padding: 30px 40px;
    text-align: center;
    position: relative;
}

.memorial-title {
    font-size: 2.5rem;
    margin: 0;
    font-weight: bold;
    position: relative;
    z-index: 1;
}

.memorial-content {
    padding: 40px;
    background: white;
}

.memorial-photo-section {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    margin-bottom: 40px;
    padding: 0;
}

.memorial-photo {
    flex-shrink: 0;
}

.memorial-photo img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.memorial-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.flower-button {
    background: #8B4513;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    align-self: flex-start;
}

.flower-button:hover {
    background: #A0522D;
}

.condolence-message {
    background: #f8f8f8;
    padding: 15px;
    border-radius: 5px;
    color: #666;
    font-size: 14px;
    border: 1px solid #e0e0e0;
}

.memorial-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
    padding: 0;
}

.memorial-info-left h3,
.memorial-info-right h3 {
    color: #8B4513;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #8B4513;
    font-size: 18px;
    font-weight: bold;
}

.info-item {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    padding: 5px 0;
}

.info-item strong {
    min-width: 80px;
    color: #333;
    margin-right: 10px;
    font-weight: bold;
    font-size: 14px;
}

.info-item span {
    color: #555;
    flex: 1;
    font-size: 14px;
}

.memorial-introduction {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.memorial-introduction h3 {
    color: #8B4513;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
}

.memorial-introduction p {
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

.memorial-condolences {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f8f8;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.condolence-count {
    color: #666;
    font-size: 14px;
}

.condolence-count .count {
    color: #8B4513;
    font-weight: bold;
    font-size: 16px;
}

.write-condolence-button {
    background: #8B4513;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.write-condolence-button:hover {
    background: #A0522D;
}

.memorial-messages {
    background: white;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.memorial-messages h3 {
    color: #8B4513;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
    padding-bottom: 10px;
    border-bottom: 2px solid #8B4513;
}

.condolence-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background: white;
    border: 1px solid #ddd;
}

.condolence-table th {
    background: #f5f5f5;
    color: #333;
    padding: 12px 10px;
    text-align: left;
    font-weight: bold;
    font-size: 14px;
    border-bottom: 1px solid #ddd;
}

.condolence-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
    font-size: 13px;
    color: #555;
}

.condolence-table tr:hover {
    background: #f9f9f9;
}

.condolence-table tr:last-child td {
    border-bottom: none;
}

/* Melorial 단일 포스트 반응형 */
@media (max-width: 768px) {
    .memorial-single {
        padding: 20px 10px;
    }
    
    .memorial-card {
        border-radius: 15px;
    }
    
    .memorial-header {
        padding: 30px 20px;
    }
    
    .memorial-title {
        font-size: 2.2rem;
    }
    
    .memorial-content {
        padding: 20px;
    }
    
    .memorial-photo-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 25px;
        padding: 20px;
    }
    
    .memorial-photo img {
        width: 150px;
        height: 150px;
    }
    
    .memorial-details {
        grid-template-columns: 1fr;
        gap: 25px;
        padding: 20px;
    }
    
    .memorial-condolences {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 20px;
    }
    
    .condolence-table {
        font-size: 14px;
    }
    
    .condolence-table th,
    .condolence-table td {
        padding: 12px 8px;
    }
    
    .memorial-messages {
        padding: 20px;
    }
}

/* 빈소현황 리스트 스타일 */
.funeral-hall-list-container {
    max-width: 100%;
    margin: 20px 0;
    background: var(--memorial-slider-background-color, #f8f8f8);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.funeral-hall-list-header {
    background: var(--memorial-slider-header-color, #8B4513);
    color: white;
    padding: 15px 20px;
    border-bottom: 1px solid var(--memorial-slider-border-color, #e0e0e0);
}

.funeral-hall-list-header p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--memorial-slider-header-text-color, white);
}

.funeral-hall-list-header a {
    color: var(--memorial-slider-header-text-color, white);
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: opacity 0.3s ease;
}

.funeral-hall-list-header a:hover {
    opacity: 0.8;
}

.funeral-hall-list-header svg {
    width: 16px;
    height: 16px;
}

.funeral-hall-list-wrapper {
    padding: 20px;
}

.funeral-hall-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.funeral-hall-item {
    background: var(--memorial-slider-item-bg-color, white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.funeral-hall-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    background: var(--memorial-slider-item-hover-color, #f0f0f0);
}

.funeral-hall-item:hover .funeral-hall-link {
    color: var(--memorial-slider-text-hover-color, #8B4513);
}

.funeral-hall-item:hover .funeral-hall-room span,
.funeral-hall-item:hover .funeral-hall-room b {
    color: var(--memorial-slider-text-hover-color, #8B4513);
}

.funeral-hall-link {
    display: block;
    padding: 20px;
    text-decoration: none;
    color: var(--memorial-slider-text-color, #333);
    transition: all 0.3s ease;
}

.funeral-hall-link:hover {
    color: var(--memorial-slider-text-hover-color, #8B4513);
}

.funeral-hall-link:hover .funeral-hall-room span,
.funeral-hall-link:hover .funeral-hall-room b {
    color: var(--memorial-slider-text-hover-color, #8B4513);
}

.funeral-hall-room {
    text-align: center;
}

.funeral-hall-room span {
    display: block;
    font-size: 14px;
    color: var(--memorial-slider-text-color, #8B4513);
    font-weight: 600;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.funeral-hall-room b {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--memorial-slider-text-color, #333);
    margin-top: 8px;
    transition: color 0.3s ease;
}



/* 모바일 반응형 */
@media (max-width: 768px) {
    .funeral-hall-list-container {
        margin: 15px 0;
    }
    
    .funeral-hall-list-header {
        padding: 12px 15px;
    }
    
    .funeral-hall-list-header p {
        font-size: 14px;
    }
    
    .funeral-hall-list-header a {
        font-size: 12px;
    }
    
    .funeral-hall-list-wrapper {
        padding: 15px;
    }
    
    .funeral-hall-list {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .funeral-hall-link {
        padding: 15px;
    }
    
    .funeral-hall-room b {
        font-size: 20px;
    }
    
    .funeral-slider-table {
        font-size: 12px;
    }
    
    .funeral-slider-table th {
        width: 50px;
        padding: 6px 0;
    }
    
    .funeral-slider-table td {
        padding: 6px 0 6px 10px;
    }
    
    .funeral-slider-table .pc {
        display: none;
    }
    
    .funeral-slider-table .mobile {
        display: inline;
    }
    
    .funeral-slider-pagination {
        padding: 12px 15px;
    }
    
    .funeral-slider-pagination b {
        font-size: 12px;
    }
}

/* 슬라이더 자동 전환 애니메이션 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.funeral-slider-item.select {
    animation: slideIn 0.5s ease;
}
