/* common.css - 공통 스타일 */

.error-modal h2 {
    margin-top: 0;
    text-align: center;
}
.error-modal p {
    margin: 10px 0;
    font-size: 0.9rem;
}
.error-modal pre {
    background: #333;
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}
.error-modal button {
    display: block;
    margin: 20px auto 0;
    padding: 10px 20px;
    background: #ff9800;
    border: none;
    border-radius: 5px;
    color: #121212;
    cursor: pointer;
}
.error-modal button:hover {
    background: #e68900;
}
body {
    overflow-x: hidden;
    box-sizing: border-box;
}

#errorModalClose,
.error-modal {
    box-sizing: border-box;
}

/* 기본 설정 */
body {
  margin: 0;
  padding: 0;
  background-color: #121212; /* 기존 배경색 유지 */
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh; /* 화면 전체 높이 */
  overflow-x: hidden; /* 좌우 스크롤 제거 */
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: #e0e0e0;
}

/* 상단 바 */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #1e1e1e;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
}

.topbar .logo a {
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
  color: #e0e0e0;
  transition: color 0.3s ease, background-color 0.3s ease;
  padding: 5px 10px;
  border-radius: 5px;
}

.topbar .logo a:hover {
  color: #121212;
  background-color: #ff9800;
}

.topbar .logout a {
  text-decoration: none;
  font-size: 1.5rem;
  color: #ff9800;
}

.topbar .logout a:hover {
  color: #e68900;
}

/* 상단 바 뒤로가기 버튼 스타일 */
.topbar .back {
  margin-right: 10px; /* 로고와의 간격 */
}

.topbar .back a {
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
  color: #e0e0e0;
  transition: color 0.3s ease, background-color 0.3s ease;
  padding: 5px 10px;
  border-radius: 5px;
  display: inline-block;
}

.topbar .back a:hover {
  color: #121212;
  background-color: #ff9800;
}

.thumb.loading {
  position: relative;
}

/* 로딩 스피너를 나타내는 ::before 가상 요소 */
.thumb.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px; /* height/2 */
  margin-left: -15px; /* width/2 */
  border: 4px solid #f3f3f3; /* 연한 회색 */
  border-top: 4px solid #3498db; /* 파란색 */
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 2;
}

.new-badge {
	position:absolute;
	top:5px;
	left:5px;
	background:red;
	color:white;
	font-size:0.7em;
	padding:2px 4px;
	border-radius:3px;
	z-index:10;
}

/* 읽음 배지 스타일 */
.read-badge {
    position: absolute;
    bottom: 14px;  /* 하단에 위치 */
    left: 5px;    /* 왼쪽에 위치 */
    background-color: blue;  /* 파란색 배경 */
    color: white; /* 텍스트 색상 */
    font-size: 0.7em;
    padding: 2px 4px;
    border-radius: 3px;
    z-index: 10; /* 다른 요소들보다 위에 표시 */
}

/* 즐겨찾기 배지 스타일 */
.favorite-badge {
    position: absolute;
    top: 5px;     /* 상단에 위치 */
    right: 5px;   /* 오른쪽에 위치 */
    font-size: 1.2em; /* 아이콘 크기 조정 */
    z-index: 10;  /* 다른 요소들보다 위에 표시 */
}

.thumb {
  width: 100%;
  height: 200px;  /* 고정 높이 지정 */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #333;
}

.thumb img {
  max-width: 100%;
  max-height: 100%;
  height: 200px;
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}

.no-thumb {
  width: 100%;
  height: 200px;  /* 썸네일 영역과 동일한 높이 */
  background-color: #444;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-size: 0.9rem;
}

.thumb-container {
	position:relative;
	width:100%;
}

/* 오버레이 스타일 */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 1.0); /* 반투명 배경 */
    backdrop-filter: blur(5px);  /* 배경 흐리게 */
    display: none;
    z-index: 9999; /* 다른 요소들 위에 표시 */
    pointer-events: auto;
}

/* 메시지와 인디케이터 스타일 */
#overlay .message-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* 가운데 정렬 */
    text-align: center;
    padding: 30px;
    background-color: #333; /* 어두운 배경 */
    border-radius: 10px;
    color: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
    width: 300px;
}

#overlay .loading-message, #overlay .completed-message, #overlay .error-message {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
}

/* 로딩 인디케이터 */
#overlay .loading-indicator {
    width: 30px;
    height: 30px;
    margin-top: 20px;  /* 메시지 아래에 인디케이터 배치 */
    border: 4px solid #f3f3f3; /* 연한 회색 */
    border-top: 4px solid #3498db; /* 파란색 */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: auto;
    margin-right: auto;
}

/* 완료 메시지 스타일 */
#overlay .completed-message {
    color: #4CAF50; /* 녹색 완료 메시지 */
}

/* 오류 메시지 스타일 */
#overlay .error-message {
    color: #FF5252; /* 빨간색 오류 메시지 */
}

/* 회전 애니메이션 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 툴팁 메뉴 */
#tooltip-menu {
    display: none;
    position: absolute;
    background: #333;
    color: #fff;
    padding: 5px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    font-size: 0.8rem;
    width: 120px; /* 툴팁 넓이 */
    min-width: 120px;  /* 툴팁의 최소 너비 */
    max-width: 180px;  /* 툴팁의 최대 너비 */
}

#tooltip-menu div {
    padding: 8px;
    background-color: #444;
    color: #fff;
    border: 1px solid #555;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* 툴팁 메뉴 항목에 마우스를 올렸을 때 */
#tooltip-menu div:hover {
    background-color: #555;
    transform: scale(1.05);
}

/* 툴팁 메뉴 항목 클릭 시 */
#tooltip-menu div:active {
    background-color: #666;
}

/* 툴팁 메뉴 항목 간 간격 */
#tooltip-menu div {
    margin: 10px 0px;
}
#tooltip-menu i {
    margin-right: 5px;
}

/* 구분선 스타일 */
#tooltip-menu hr {
    border: 1px solid #555;
    margin: 10px 0;
	background: none;
    border: none;
    color: #555;
}
