/* 메인페이지 스타일 */
.search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.search-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.search-btn {
    padding: 12px 20px;
    background-color: #4a90e2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
}

.search-btn:hover {
    background-color: #357abd;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.content-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.card-image {
    width: 100%;
    height: 200px;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.card-info {
    padding: 15px;
}

.card-info h3 {
    margin-bottom: 10px;
    color: #333;
}

.card-info p {
    color: #666;
    font-size: 14px;
}

.menu-list {
    list-style: none;
}

.menu-list li {
    margin-bottom: 10px;
}

.menu-list a {
    text-decoration: none;
    color: #333;
    display: block;
    padding: 8px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.menu-list a:hover {
    background-color: #f0f0f0;
}

.popular-list {
    list-style: none;
}

.popular-list li {
    padding: 10px;
    margin-bottom: 5px;
    background-color: #f9f9f9;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.popular-list li:hover {
    background-color: #f0f0f0;
}

.content-card.hidden {
    display: none;
}

/* 로딩 오버레이 스타일 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    background-color: white;
    padding: 30px 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.loading-spinner p {
    margin-top: 20px;
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a90e2;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
/* 사이드바 채팅 목록 스타일 */
.chat-item-sidebar {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.chat-item-sidebar:hover {
    background-color: #f0f8ff;
}

.chat-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 10px;
    text-decoration: none;
    color: #333;
    width: 100%;
}

.chat-info {
    display: flex;
    align-items: center;
    overflow: hidden;
}

.room-name {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px; /* 사이드바 너비에 맞게 조절 */
}

/* 채팅 목록 컨테이너 여백 정리 */
.popular-list {
    padding: 0;
    margin: 0;
    list-style: none; /* 점 제거 */
}

/* 개별 채팅방 카드 디자인 */
.popular-list .chat-item {
    display: block;
    background-color: #f0f8ff; /* 기본: 아주 연한 하늘색 (AliceBlue) */
    border: 1px solid #cce4ff; /* 테두리: 연한 파란색 */
    border-radius: 12px;       /* 모서리를 둥글게 */
    margin-bottom: 10px;       /* 아이템 간 간격 */
    padding: 0;                /* 내부 패딩은 a태그에서 처리 */
    transition: all 0.2s ease; /* 마우스 올렸을 때 부드럽게 변함 */
    box-shadow: 0 2px 4px rgba(74, 144, 226, 0.1); /* 살짝 그림자 */
    overflow: hidden;          /* 내부 내용이 둥근 모서리를 넘치지 않게 */
}

/* 마우스를 올렸을 때 (Hover) 효과 */
.popular-list .chat-item:hover {
    background-color: #e3f2fd;   /* 조금 더 진한 하늘색 */
    border-color: #4a90e2;       /* 테두리를 메인 파란색으로 변경 */
    transform: translateY(-3px); /* 공중에 살짝 뜨는 느낌 */
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.2); /* 그림자 진하게 */
}

/* 클릭 영역 (링크) 스타일 */
.popular-list .chat-item a {
    text-decoration: none;
    color: #333;
    display: flex;
    justify-content: space-between; /* 이름과 뱃지 양쪽 정렬 */
    align-items: center;
    width: 100%;
    padding: 15px 18px; /* 카드 내부 여백을 넓게 줌 */
}

/* 채팅방 이름 폰트 스타일 */
.popular-list .chat-item .room-name {
    font-weight: 600;
    font-size: 15px;
    color: #2c3e50;
    white-space: nowrap;      /* 줄바꿈 방지 */
    overflow: hidden;         /* 넘치는 글자 숨김 */
    text-overflow: ellipsis;  /* 말줄임표(...) 처리 */
    max-width: 140px;         /* 이름이 너무 길면 잘리도록 */
}

/* 안 읽은 메시지 뱃지 (빨간 원) */
.popular-list .chat-item .badge {
    background-color: #ff4757; /* 쨍한 빨간색 */
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 20px;       /* 타원형 */
    box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3);
    animation: bounce 2s infinite; /* (선택) 톡톡 튀는 애니메이션 */
}

/* (선택) 뱃지가 튀어오르는 애니메이션 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-3px);}
    60% {transform: translateY(-1.5px);}
}


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

