* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
  font-family: 'Georgia', serif; 
  background: linear-gradient(135deg, #f5f0fb 0%, #f9f5ef 100%);
  color: #333; 
  padding: 20px 20px; 
}

.header-area { text-align: center; margin-bottom: 30px; position: relative; background: linear-gradient(135deg, #4a235a 0%, #6a0dad 100%); padding: 25px 20px; border-radius: 12px; box-shadow: 0 4px 15px rgba(74, 35, 90, 0.2); }

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

h1 { font-size: 2.2rem; color: white; margin-bottom: 0; }

.display-name { color: #e0d5f0; font-style: italic; font-size: 1.1rem; margin: 15px 0 0 0; }

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 999;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
  display: block;
}

.hamburger:hover span {
  background: #e0d5f0;
  box-shadow: 0 2px 5px rgba(224, 213, 240, 0.3);
}

.menu {
  position: absolute;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f9f5ef 100%);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.1);
  min-width: 240px;
  z-index: 1000;
  overflow: hidden;
  animation: slideDown 0.35s cubic-bezier(0.23, 1, 0.320, 1);
  border: 1px solid rgba(106, 10, 173, 0.1);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  color: #4a235a;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.25s ease;
  border-bottom: 1px solid rgba(106, 10, 173, 0.08);
  cursor: pointer;
  position: relative;
  font-size: 0.95rem;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item span {
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(106, 10, 173, 0.08);
  border-radius: 8px;
  transition: all 0.25s ease;
}

.menu-item:hover span {
  background: rgba(106, 10, 173, 0.15);
  transform: scale(1.1);
}

.menu-item:hover {
  background: linear-gradient(135deg, #f0e6ff 0%, #f9f5ef 100%);
  padding-left: 28px;
  color: #6a0dad;
  transform: translateX(2px);
}

.menu-item.menu-logout:hover {
  background: linear-gradient(135deg, #fdeded 0%, #ffcdd2 100%);
  color: #c62828;
}

.hidden {
  display: none !important;
}

.info-input { 
  border: none; 
  border-bottom: 1px dashed #6a0dad; 
  background: transparent; 
  padding: 5px; 
  text-align: center; 
  font-family: inherit; 
  margin: 0 5px; 
}

.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tab-nav {
  display: flex;
  gap: 5px;
  border-bottom: 2px solid #6a0dad;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 12px 20px;
  background: #f0e6ff;
  border: none;
  border-bottom: 3px solid transparent;
  color: #4a235a;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
  margin-right: 2px;
  border-radius: 8px 8px 0 0;
}

.tab-btn:nth-child(4) {
  background: #e8f5e9;
  color: #2e7d32;
}

.tab-btn:hover {
  color: #6a0dad;
  background: #e8d5f5;
}

.tab-btn:nth-child(4):hover {
  background: #c8e6c9;
}

.tab-btn.active {
  color: white;
  background: #6a0dad;
  border-bottom-color: #2e7d32;
}

.tab-btn:nth-child(4).active {
  background: #2e7d32;
  border-bottom-color: #66bb6a;
}

.main-content {
  width: 100%;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.log-box-full {
  flex-direction: column;
  height: auto;
}

.log-box-full .log-columns {
  flex-grow: 1;
  min-height: 450px;
}

.progress-container-h {
  width: 100%;
  height: 8px;
  background: #e0d5f0;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid #6a0dad;
  margin-bottom: 15px;
}

.progress-fill-h {
  height: 100%;
  background: linear-gradient(to right, #2e7d32, #66bb6a);
  transition: width 0.5s ease;
  width: 0%;
}

.log-box { 
  background: white; 
  border: 2px solid #6a0dad; 
  border-radius: 8px; 
  padding: 20px; 
  display: flex; 
  flex-direction: column;
  gap: 15px; 
  box-shadow: 0 4px 15px rgba(106, 10, 173, 0.1);
}

.progress-container-v { 
  width: 18px; 
  background: #e0d5f0; 
  border-radius: 9px; 
  position: relative; 
  overflow: hidden; 
  border: 1px solid #6a0dad; 
  height: 100%; 
  flex-shrink: 0; 
}

.progress-fill-v { 
  position: absolute; 
  bottom: 0; 
  width: 100%; 
  background: linear-gradient(to top, #2e7d32, #66bb6a); 
  transition: height 0.5s ease; 
  height: 0%; 
}

.log-content { flex: 1; display: flex; flex-direction: column; }

.log-header-row { 
  display: grid; 
  grid-template-columns: 1fr 1fr 1fr; 
  gap: 8px; 
  padding-bottom: 10px; 
  border-bottom: 2px solid #6a0dad; 
  margin-bottom: 10px; 
}

.log-columns { 
  display: grid; 
  grid-template-columns: 1fr 1fr 1fr; 
  gap: 8px; 
  flex-grow: 1;
  min-height: 0;
}

.log-col {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 6px;
  background: #fafaf8;
  border-radius: 4px;
  border: 1px solid #e8e0f0;
  max-height: 400px;
  flex: 1;
}

.log-col::-webkit-scrollbar { width: 5px; }
.log-col::-webkit-scrollbar-track { background: transparent; }
.log-col::-webkit-scrollbar-thumb { background: #c4a8d6; border-radius: 3px; }

.log-col-title { font-weight: bold; color: #6a0dad; font-size: 0.7rem; text-align: center; }

.log-entry { 
  margin-bottom: 5px; 
  font-size: 0.7rem; 
  padding: 4px 6px;
  background: #e8f5e9;
  border-radius: 3px;
  border-left: 3px solid #2e7d32;
  color: #1b5e20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
}

.log-date { 
  font-size: 0.55rem; 
  color: #999; 
  white-space: nowrap;
  flex-shrink: 0;
}

#cheer-bubble {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #6a0dad; color: white; padding: 15px 30px; border-radius: 50px;
  font-weight: bold; font-size: 1.2rem; box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 2000; display: none; pointer-events: none; animation: popFade 2s forwards;
}

@keyframes popFade {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.8); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.9); }
}

.btn-group { display: flex; gap: 8px; margin-top: 10px; }
.btn { flex: 1; padding: 8px; border-radius: 4px; cursor: pointer; font-size: 0.7rem; font-weight: bold; border: 1px solid; }

.reset-btn { background: #fdeded; color: #c62828; border-color: #ffcdd2; }
.save-btn { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }

.reset-btn:hover { 
  background: #ffcdd2;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.2);
}

.save-btn:hover { 
  background: #2e7d32;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
}

.testament-header { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  border-bottom: 2px solid #6a0dad; 
  padding: 15px 0 8px; 
  margin-top: 15px;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
}

.testament-header:hover h2 {
  color: #6a0dad;
}

.testament-header h2 { 
  font-size: 1.5rem; 
  color: #4a235a; 
  transition: color 0.3s ease;
}

.v-toggle { 
  width: 30px; height: 30px; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  cursor: pointer;
  transition: all 0.3s ease;
}

.v-toggle:hover {
  transform: scale(1.1);
}

.v-toggle::after { 
  content: ''; 
  width: 8px; height: 8px; 
  border-right: 2.5px solid #6a0dad; 
  border-bottom: 2.5px solid #6a0dad; 
  transform: rotate(45deg); 
  transition: transform 0.3s ease;
}

.v-toggle.closed::after { transform: rotate(-135deg); }

.hidden { display: none; }

.book { 
  margin-bottom: 10px; 
  background: #fff; 
  border-radius: 8px; 
  border: 1px solid #e0d5f0; 
  overflow: hidden; 
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(106, 10, 173, 0.08);
}

.book:hover {
  box-shadow: 0 4px 12px rgba(106, 10, 173, 0.15);
}

#ps-cont .chapters { 
  background: #fff; 
  border-radius: 8px; 
  border: 1px solid #e0d5f0; 
  margin-top: 10px; 
}

.book-header { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  cursor: pointer; 
  padding: 10px; 
  font-weight: bold; 
  color: #4a235a; 
  font-size: 0.95rem; 
}

.book-header.in-progress { background-color: #fff3e0; }
.book-header.finished { background-color: #e8f5e9; }

.book-v { 
  width: 7px; height: 7px; 
  border-right: 2px solid #6a0dad; 
  border-bottom: 2px solid #6a0dad; 
  transform: rotate(45deg); 
  transition: transform 0.2s; 
  margin-bottom: 3px; 
}

.collapsed .book-v { 
  transform: rotate(-45deg); 
  margin-bottom: 0; 
  margin-left: 3px; 
}

.collapsed + .chapters { display: none; }

.chapters { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 6px; 
  padding: 12px; 
  border-top: 1px solid #eee; 
}

.chapter { 
  width: 32px; 
  height: 32px; 
  border-radius: 50%; 
  border: 1px solid #6a0dad; 
  color: #6a0dad; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 0.7rem; 
  cursor: pointer; 
  transition: 0.2s; 
}

.chapter:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(106, 10, 173, 0.2);
}

.chapter.read { 
  background-color: #2e7d32; 
  border-color: #2e7d32; 
  color: white; 
  cursor: default;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

#modal-overlay { 
  position: fixed; 
  top: 0; left: 0; 
  width: 100%; height: 100%; 
  background: rgba(0,0,0,0.5); 
  display: none; 
  justify-content: center; 
  align-items: center; 
  z-index: 3000; 
}

.modal-content { 
  background: white; 
  padding: 25px; 
  border-radius: 12px; 
  text-align: center; 
  max-width: 380px; 
}

#m-title { color: #4a235a; font-size: 1.3rem; margin-bottom: 12px; }
#m-text { color: #666; margin-bottom: 20px; font-size: 0.95rem; }

#m-btns { display: flex; gap: 10px; }
.modal-btn { 
  flex: 1; 
  padding: 10px 15px; 
  border: none; 
  border-radius: 6px; 
  cursor: pointer; 
  font-weight: bold; 
  background: #6a0dad; 
  color: white; 
  transition: opacity 0.2s;
}
.modal-btn:hover { opacity: 0.85; }

/* Login Page Styling */
.login-body {
  background: linear-gradient(135deg, #4a235a 0%, #6a0dad 50%, #8b5a9f 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Georgia', serif;
  margin: 0;
  padding: 20px;
}

.login-container {
  background: white;
  padding: 50px 40px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 100%;
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-container h1 {
  color: #4a235a;
  font-size: 2rem;
  text-align: center;
  margin-bottom: 30px;
  font-weight: bold;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#login-form input {
  padding: 12px 16px;
  border: 2px solid #e0d5f0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

#login-form input:focus {
  outline: none;
  border-color: #6a0dad;
  box-shadow: 0 0 8px rgba(106, 10, 173, 0.2);
  background-color: #fafaf8;
}

#login-form input::placeholder {
  color: #999;
}

#main-btn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #6a0dad, #8b5a9f);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  font-family: inherit;
}

#main-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(106, 10, 173, 0.3);
}

#main-btn:active {
  transform: translateY(0);
}

.switch-link {
  text-align: center;
  margin-top: 20px;
  color: #666;
  font-size: 0.95rem;
}

.switch-link a {
  color: #6a0dad;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.switch-link a:hover {
  border-bottom-color: #6a0dad;
  color: #4a235a;
}

#message {
  min-height: 20px;
  text-align: center;
  font-size: 0.9rem;
  margin-top: 16px;
  padding: 8px 12px;
  border-radius: 6px;
  display: none;
}

#message:not(:empty) {
  display: block;
}

#message.success {
  background: #e8f5e9;
  color: #2e7d32;
  border-left: 4px solid #2e7d32;
}

#message.error {
  background: #fdeded;
  color: #c62828;
  border-left: 4px solid #c62828;
}

/* Profile Page Styling */
.profile-container {
  max-width: 500px;
  margin: 40px auto;
  background: white;
  padding: 40px;
  border-radius: 12px;
  border: 2px solid #6a0dad;
  box-shadow: 0 8px 25px rgba(106, 10, 173, 0.15);
}

.profile-container h2 {
  color: #4a235a;
  margin-bottom: 30px;
  text-align: center;
}

.profile-field {
  margin-bottom: 25px;
}

.profile-field label {
  display: block;
  color: #6a0dad;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 1rem;
}

.profile-field input,
.profile-field p {
  width: 100%;
  padding: 12px;
  border: 1px solid #6a0dad;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.profile-field input {
  background: #f9f5ef;
}

.profile-field input:focus {
  outline: none;
  border-color: #4a235a;
  box-shadow: 0 0 12px rgba(106, 10, 173, 0.2);
  background: white;
}

.profile-field p {
  background: #f0e6ff;
  border: 1px solid #d0b5f7;
  color: #333;
}

.profile-container .btn-group {
  display: flex;
  gap: 15px;
  margin-top: 30px;
}

.profile-container .btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
}

.save-btn {
  background: #2e7d32;
  color: white;
}

.save-btn:hover {
  background: #1b5e20;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.cancel-btn {
  background: #9c27b0;
  color: white;
}

.cancel-btn:hover {
  background: #6a0dad;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(106, 10, 173, 0.3);
}

.profile-container .message {
  margin-bottom: 20px;
  padding: 12px;
  border-radius: 6px;
  text-align: center;
  font-weight: bold;
  display: none;
}

.profile-container .message.success {
  background: #c8e6c9;
  color: #1b5e20;
  display: block;
}

.profile-container .message.error {
  background: #ffcdd2;
  color: #c62828;
  display: block;
}

.back-link {
  text-align: center;
  margin-top: 20px;
}

.back-link a {
  color: #6a0dad;
  text-decoration: none;
  font-weight: bold;
}

.back-link a:hover {
  text-decoration: underline;
}

.loading-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  z-index: 1000;
}

.hidden {
  display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-area {
    padding: 20px 15px;
  }

  .header-top {
    margin-bottom: 10px;
  }

  h1 {
    font-size: 1.8rem;
  }

  .display-name {
    font-size: 1rem;
    margin: 10px 0 0 0;
  }

  .menu {
    top: 70px;
    right: 10px;
    left: auto;
  }

  .container {
    grid-template-columns: 1fr;
  }

  .sidebar-wrapper {
    height: auto;
    position: relative;
    top: auto;
  }

  .book-header {
    font-size: 0.85rem;
  }

  .profile-container {
    margin: 20px 15px;
    padding: 25px 20px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 15px 10px;
  }

  .header-area {
    margin-bottom: 20px;
    padding: 15px 10px;
    border-radius: 8px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .hamburger {
    padding: 5px;
  }

  .hamburger span {
    width: 20px;
    height: 2.5px;
  }

  .menu {
    min-width: 160px;
  }

  .menu-item {
    padding: 12px 15px;
    font-size: 0.9rem;
  }

  .profile-container {
    margin: 15px 10px;
    padding: 20px 15px;
  }

  .profile-container h2 {
    font-size: 1.5rem;
  }

  .profile-field label {
    font-size: 0.9rem;
  }

  .profile-container .btn {
    font-size: 0.9rem;
    padding: 10px;
  }

  .chapter {
    width: 28px;
    height: 28px;
    font-size: 0.6rem;
  }

  .btn-group {
    gap: 6px;
  }

  .btn {
    font-size: 0.6rem;
    padding: 6px;
  }
}