/* Pretendard 폰트 import */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css");

/* 공통 스타일 */

body {
  margin: 0;
  padding: 0;
  display: flex;
  height: 100vh;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui,
    Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR",
    "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
    sans-serif;
  position: relative;
}

body.login-body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: transparent;
  z-index: 0;
}

body.login-body {
  background: #ffffff;
}

a {
  text-decoration: none;
}

/* 로그인 페이지 스타일 */
.login-container,
.register-container {
  background: transparent;
  text-align: center;
  width: 90vw;
  max-width: 400px;
  margin: auto;
  position: relative;
  z-index: 2;
}

/* 버튼 그룹 스타일 */
.button-group {
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-container .sideLink,
.register-container .sideLink {
  margin-top: 15px;
  color: #979797;
}

.logo {
  width: 60px;
}

.login-form,
.register-form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.input-group {
  position: relative;
  text-align: left;
}

.input-group input {
  width: 95%;
  background: transparent;
  border: none;
  color: #333;
  font-size: 16px;
  padding: 10px 0;
  outline: none;
}

/* 자동완성 시 배경색 투명 유지 */
.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus,
.input-group input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
  -webkit-text-fill-color: #333 !important;
  background-color: transparent !important;
  background: transparent !important;
  transition: background-color 5000s ease-in-out 0s !important;
}

.input-group input::placeholder {
  color: rgba(0, 0, 0, 0.6);
}

.input-line {
  height: 1px;
  background: #afafaf;
  margin-top: 5px;
  transition: all 0.3s ease;
}

.input-group input:focus + .input-line {
  background: #3f3f3f;
  height: 1px;
}

.login-form input,
.register-form input {
  padding: 10px 0;
  font-size: 13px;
  border-radius: 5px;
  border: none;
  box-shadow: none;
  outline: none;
}

.login-form button,
.register-form button {
  padding: 12px 15px;
  font-size: 16px;
  color: #fff;
  background-color: #3f3f3f;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  height: 45px;
  font-weight: 600;
  letter-spacing: 1px;
}

.login-btn {
  background-color: #3f3f3f !important;
}

.login-btn:hover {
  background-color: #2a2a2a !important;
  transform: translateY(-1px);
}

.login-form button:hover,
.register-form button:hover {
  background-color: #2a2a2a;
}

/* 메인 페이지 스타일 */
.sidebar {
  width: 150px;
  background-color: #f4f4f4;
  box-shadow: 3px 0 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 100;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
}

.maincontent {
  margin-left: 150px;
  width: -webkit-fill-available;
}

/* 모달 스타일 */
#overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 101;
}

#editModal,
#periodModal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  padding: 20px;
  z-index: 102;
  border-radius: 8px;
  box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.3);
  max-height: 85vh;
  overflow: auto;
}

#editModal form .title,
#periodModal form .title {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background-color: #3f3f3f;
  margin-bottom: 20px;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
}

#editModal::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

#editModal::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 3px;
}

#editModal::-webkit-scrollbar-thumb {
  background: #c6c6c6;
  border-radius: 3px;
}

#editModal::-webkit-scrollbar-thumb:hover {
  background: #555;
}

#editModal input,
#editModal select,
#editModal textarea,
#editModal .noneditData,
#periodModal input,
#periodModal select,
#periodModal textarea,
#periodModal .noneditData {
  box-sizing: border-box;
  padding: 7px;
  height: 38px;
  font-size: 13px;
  border: 1px solid #ccc;
  width: 200px;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  margin-bottom: 0;
}

#editModal input:focus,
#periodModal input:focus {
  outline: none;
  box-shadow: none;
}

#editModal form,
#periodModal form {
  display: block;
}

/* 모바일 반응형 - 사이드바가 숨겨질 때 maincontent 마진 제거 */
@media (max-width: 1024px) {
  .maincontent {
    margin-left: 0;
    padding: 20px;
  }
}

.logo-container {
  padding: 5px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
}

.logo-container img {
  width: 60px;
  height: auto;
  margin: 14px;
  border-radius: 8px;
}

h1.menutitle {
  font-size: 15px;
  color: #333;
  margin: 0;
  font-weight: bold;
  line-height: 20px;
  margin-bottom: 10px;
}

h1.pagetitle {
  margin: 0;
  font-size: 18px;
  color: #333;
  font-weight: bold;
}

.user-info {
  padding: 15px;
  background-color: #3f3f3f;
  margin-bottom: 10px;
}

.user-info span {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: #333;
}

.user-info span.welcome_text {
  font-weight: 500;
  color: #fff;
}

.mypage-btn {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 5px 10px;
  cursor: pointer;
  height: 28px;
  font-size: 13px;
  font-weight: bold;
  width: -webkit-fill-available;
}

.menu ul {
  padding: 0;

  padding-left: 20px;
  padding-right: 10px;

  margin: 0;
  cursor: pointer;
}

.menu li {
  position: relative;
  display: flex;
  height: 20px;
  align-items: center;
  font-size: 13px;
  color: #333;
  font-weight: 400;
  margin-left: 20px;
  padding: 4px;
}

.menu li::before {
  position: absolute;
  top: 0px;
  left: -12px;
  width: 7px;
  height: 50%;
  border-left: 1px solid #c1c1c1;
  border-bottom: 1px solid #c1c1c1;
  content: "";
}

.menu li.middle::after {
  position: absolute;
  bottom: 0px;
  left: -12px;
  width: 7px;
  height: 50%;
  border-left: 1px solid #c1c1c1;
  content: "";
}

.menu ul:hover,
.menu ul:hover li {
  background-color: #333;
  color: #fff;
}

.menu ul.active,
.menu ul.active li {
  background-color: #333;
  color: #fff;
}

.menu li .sidebar_icon {
  margin-right: 6px;
  font-size: 17px;
}

.menu .line {
  display: flex;
  flex-direction: row;
  align-items: center;
  font-size: 13px;
  color: #333;
  font-weight: 700;
  margin: 15px 10px 0;
  padding-left: 10px;
  padding-bottom: 4px;
}

.menu .line span {
  margin-right: 10px;
  font-size: 20px;
}

.content.mainpage {
  padding: 20px 25px;
}

.content.mainpage .option {
  margin-top: 7px;
  font-size: 14px;
  font-weight: 500;
}

/* 정보 수정폼  */

/* 폼 전체 스타일  ----------------------------- */

/* 폼 요소를 가로로 정렬하는 플렉스 박스 설정 */
.form-group {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

/* 레이블 스타일 */
.form-group label {
  display: flex;
  width: 90px;
  font-weight: 500;
  font-size: 13px;
  justify-content: center;
  background-color: #eaedff;
  border: 1px solid #ccc;
  height: 36px;
  align-items: center;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

/* 인풋, 텍스트 에어리어 스타일 */
.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea {
  padding: 7px;
  border: 1px solid #ccc;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  box-sizing: border-box;
  font-size: 13px;
  height: 38px;
  width: calc(100% - 140px);
}

/* editform 버튼 스타일 */

.btn-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.btn-group button {
  padding: 8px 16px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.btn-group .green {
  background-color: #28a745;
  color: white;
}

.btn-group .green:hover {
  background-color: #218838;
}

.btn-group .black {
  background-color: #6c757d;
  color: white;
}

.btn-group .black:hover {
  background-color: #545b62;
}

.btn-group .red {
  background-color: #dc3545;
  color: white;
}

.btn-group .red:hover {
  background-color: #c82333;
}

/* 로그인 페이지 반응형 스타일 */
@media (max-width: 768px) {
  .login-container,
  .register-container {
    width: 95vw;
    padding: 20px;
  }

  .input-group input {
    font-size: 14px;
    padding: 10px 0;
  }

  .login-form button,
  .register-form button {
    height: 45px;
    font-size: 14px;
    letter-spacing: 1px;
  }
}

@media (max-width: 480px) {
  .login-container,
  .register-container {
    width: 98vw;
    padding: 15px;
  }

  .input-group input {
    font-size: 13px;
    padding: 8px 0;
  }

  .login-form button,
  .register-form button {
    height: 40px;
    font-size: 13px;
    letter-spacing: 1px;
  }
}

/* 모바일 헤더 스타일 */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 60px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-sizing: border-box;
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.mobile-logo img {
  width: 30px;
  height: 30px;
}

.mobile-logo span {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

/* 모바일 햄버거 메뉴 버튼 */
.mobile-menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  background: transparent;
  border: none;
}

.hamburger-line {
  width: 24px;
  height: 3px;
  background: #333;
  transition: all 0.3s ease;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 8px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -8px);
}

/* 모바일 메뉴 컨테이너 */
.mobile-menu-container {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  width: 100%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 999;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  box-sizing: border-box;
}

.mobile-menu-container.mobile-open {
  transform: translateY(0);
}

.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  height: calc(100vh - 60px);
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.mobile-menu-overlay.active {
  display: block;
}

/* 모바일 사용자 정보 */
.mobile-user-info {
  padding: 20px;
  background-color: #3f3f3f;
  color: #fff;
}

.mobile-user-info .welcome_text {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  color: #fff;
}

.mobile-user-info .mypage-btn {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
  width: 100%;
  height: 42px;
}

/* 모바일 메뉴 스타일 */
.mobile-menu {
  padding: 20px 0;
}

.mobile-menu .line {
  display: flex;
  align-items: center;
  font-size: 14px;
  color: #333;
  font-weight: 700;
  margin: 20px 20px 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.mobile-menu .line span {
  margin-right: 10px;
  font-size: 20px;
}

.mobile-menu ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.mobile-menu li {
  padding: 15px 20px;
  font-size: 14px;
  color: #333;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.mobile-menu li:hover,
.mobile-menu ul.active li {
  background-color: #f8f9fa;
  color: #333;
}

.mobile-menu a {
  text-decoration: none;
  color: inherit;
}

/* 모바일 반응형 */
@media (max-width: 1024px) {
  .mobile-header {
    display: flex;
  }

  .mobile-menu-container {
    display: block;
  }

  .sidebar {
    display: none;
  }

  body {
    padding-top: 60px;
  }
}

/* 데스크톱에서는 모바일 헤더 숨김 */
@media (min-width: 1025px) {
  .mobile-header {
    display: none;
  }

  .mobile-menu-container {
    display: none;
  }

  .sidebar {
    display: block;
  }

  body {
    padding-top: 0;
  }
}

/* 비밀번호 변경 모달 스타일 */
.password-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
}

.password-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.password-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 400px;
  max-height: 90vh;
  overflow: hidden;
}

.password-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background-color: #3f3f3f;
  color: white;
}

.password-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.password-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.password-modal-close:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.password-modal-body {
  padding: 20px;
}

.password-modal .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.password-modal .form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  font-size: 13px;
  color: #333;
  background: none;
  border: none;
  width: auto;
  height: auto;
  text-align: left;
}

.password-modal .form-group input {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  height: 40px;
}

.password-modal .form-group input:focus {
  outline: none;
  border-color: #3f3f3f;
  box-shadow: 0 0 0 2px rgba(63, 63, 63, 0.1);
}

.password-error {
  color: #dc3545;
  font-size: 12px;
  margin-bottom: 15px;
  padding: 8px;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
}

.password-modal .btn-group {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.password-modal .btn-group button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  min-width: 70px;
}

.password-modal .btn-cancel {
  background-color: #6c757d;
  color: white;
}

.password-modal .btn-cancel:hover {
  background-color: #545b62;
}

.password-modal .btn-submit {
  background-color: #28a745;
  color: white;
}

.password-modal .btn-submit:hover {
  background-color: #218838;
}

.confirm-modal .password-modal-body {
  text-align: center;
}

.confirm-modal .password-modal-body p {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: #333;
}

/* 모바일 반응형 */
@media (max-width: 480px) {
  .password-modal-content {
    width: 95%;
    margin: 10px;
  }

  .password-modal-header,
  .password-modal-body {
    padding: 15px;
  }

  .password-modal .btn-group {
    flex-direction: column;
  }

  .password-modal .btn-group button {
    width: 100%;
    margin-bottom: 10px;
  }
}

/* 토스트 메시지 스타일 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  transform: translateX(400px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  min-width: 250px;
  text-align: center;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success {
  background-color: #28a745;
  border-left: 4px solid #1e7e34;
}

.toast.error {
  background-color: #dc3545;
  border-left: 4px solid #c82333;
}

.toast.warning {
  background-color: #ffc107;
  color: #333;
  border-left: 4px solid #e0a800;
}

.toast.info {
  background-color: #17a2b8;
  border-left: 4px solid #138496;
}

/* 비밀번호 변경 토스트 스타일 */
.password-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10002;
  transform: translateX(400px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  min-width: 250px;
  text-align: center;
}

.password-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.password-toast.success {
  background-color: #28a745;
  border-left: 4px solid #1e7e34;
}

.password-toast.error {
  background-color: #dc3545;
  border-left: 4px solid #c82333;
}

/* 모바일에서 토스트 위치 조정 */
@media (max-width: 768px) {
  .toast {
    top: 80px;
    right: 10px;
    left: 10px;
    right: 10px;
    min-width: auto;
    transform: translateY(-100px);
  }

  .toast.show {
    transform: translateY(0);
  }

  .password-toast {
    top: 80px;
    right: 10px;
    left: 10px;
    right: 10px;
    min-width: auto;
    transform: translateY(-100px);
  }

  .password-toast.show {
    transform: translateY(0);
  }
}
