body {
  margin: 0;
  background: #fafafa;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #333;

  position: absolute;
  height: 100%;
  width: 100%;
  min-height: 800px;
}

#title {
  width: 900px;
  min-height: 18px;
  margin: 10px auto;
  text-align: center;
  font-size: 16px;
  color: #E2E2E2;
  font-weight: 400;
}

#title:hover {
  color: #777;
}

#viewer.spreads {

   box-shadow: 0 0 4px #ccc;
   border-radius: 5px;
   padding: 0;
   margin: 10px auto;
   background: white;
   top: calc(50vh - 400px);
 }

#viewer.spreads .epub-view > iframe {
    background: white;
}

#viewer.scrolled {
   margin: 0 auto;
   background: white;
 }

#viewer.scrolled .epub-container {
  background: white;
  box-shadow: 0 0 4px #ccc;
  margin: 10px;
  padding: 20px;
}

#viewer.scrolled .epub-view > iframe {
    background: white;
}

#prev {
  left: 0;
}

#next {
  right: 0;
}

#toc {
   display: block;
   margin: 10px auto;
 }

#pagination {
   text-align: center;
   margin: 10px auto;
   font-size: 14px;
   color: #666;
 }


.arrow {
  position: fixed;
  top: 50%;
  margin-top: -32px;
  font-size: 64px;
  color: #E2E2E2;
  font-family: arial, sans-serif;
  font-weight: bold;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  text-decoration: none;
}

.navlink {
  margin: 14px;
  display: block;
  text-align: center;
  text-decoration: none;
  color: #ccc;
}

.arrow:hover, .navlink:hover {
  color: #777;
}

.arrow:active, .navlink:hover {
  color: #000;
}

#book-wrapper {
  width: 480px;
  height: 640px;
  overflow: hidden;
  border: 1px solid #ccc;
  margin: 28px auto;
  background: #fff;
  border-radius: 0 5px 5px 0;
  position: absolute;
}

#book-viewer {
  width: 480px;
  height: 660px;
  margin: -30px auto;
  -moz-box-shadow:      inset 10px 0 20px rgba(0,0,0,.1);
  -webkit-box-shadow:   inset 10px 0 20px rgba(0,0,0,.1);
  box-shadow:           inset 10px 0 20px rgba(0,0,0,.1);
}

#book-viewer iframe {
  padding: 40px 40px;
}

#controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  width: 400px;
  margin-left: -200px;
  text-align: center;
  display: none;
}

#controls > input[type=range] {
    width: 400px;
}

#navigation {
  width: 400px;
  height: 100vh;
  position: absolute;
  overflow: auto;
  top: 0;
  left: 0;
  background: #777;
  -webkit-transition: -webkit-transform .25s ease-out;
  -moz-transition: -moz-transform .25s ease-out;
  -ms-transition: -moz-transform .25s ease-out;
  transition: transform .25s ease-out;

}

#navigation.fixed {
  position: fixed;
}

#navigation h1 {
  width: 200px;
  font-size: 16px;
  font-weight: normal;
  color: #fff;
  margin-bottom: 10px;
}

#navigation h2 {
  font-size: 14px;
  font-weight: normal;
  color: #B0B0B0;
  margin-bottom: 20px;
}

#navigation ul {
  padding-left: 36px;
  margin-left: 0;
  margin-top: 12px;
  margin-bottom: 12px;
  width: 340px;
}

#navigation ul li {
  list-style: decimal;
  margin-bottom: 10px;
  color: #cccddd;
  font-size: 12px;
  padding-left: 0;
  margin-left: 0;
}

#navigation ul li a {
  color: #ccc;
  text-decoration: none;
}

#navigation ul li a:hover {
  color: #fff;
  text-decoration: underline;
}

#navigation ul li a.active {
  color: #fff;
}

#navigation #cover {
  display: block;
  margin: 24px auto;
}

#navigation #closer {
  position: absolute;
  top: 0;
  right: 0;
  padding: 12px;
  color: #cccddd;
  width: 24px;
}

#navigation.closed {
  -webkit-transform: translate(-400px, 0);
  -moz-transform: translate(-400px, 0);
  -ms-transform: translate(-400px, 0);
}

svg {
  display: block;
}

.close-x {
  stroke: #cccddd;
  fill: transparent;
  stroke-linecap: round;
  stroke-width: 5;
}

.close-x:hover {
  stroke: #fff;
}

#opener {
  position: absolute;
  top: 0;
  left: 0;
  padding: 10px;
  stroke: #E2E2E2;
  fill: #E2E2E2;

}

#opener:hover {
   stroke: #777;
   fill: #777;
 }

#sidebar {
   position: fixed;
   left: 0;
   top: 0;
   width: 280px;
   height: 100vh;
   background: #2c3e50;
   color: #fff;
   overflow-y: auto;
   z-index: 1000;
   transition: transform 0.3s ease;
 }

#sidebar-content {
   padding: 20px;
 }

.sidebar-section {
   margin-bottom: 30px;
   border-bottom: 1px solid #34495e;
   padding-bottom: 20px;
 }

.sidebar-section h3 {
   margin: 0 0 15px 0;
   font-size: 16px;
   color: #3498db;
   text-transform: uppercase;
 }

#sidebar select, #sidebar input[type="range"], #sidebar button {
   width: 100%;
   padding: 10px;
   margin-bottom: 10px;
   border: none;
   border-radius: 4px;
   background: #34495e;
   color: #fff;
   font-size: 14px;
 }

#sidebar select:hover, #sidebar input[type="range"]:hover {
   background: #3d566e;
 }

#sidebar button {
   background: #27ae60;
   cursor: pointer;
   transition: background 0.2s;
 }

#sidebar button:hover {
   background: #2ecc71;
 }

#sidebar button#stop-btn {
   background: #c0392b;
 }

#sidebar button#stop-btn:hover {
   background: #e74c3c;
 }

#main-content {
   margin-left: 280px;
   padding: 20px;
 }

.nav-buttons {
   display: flex;
   justify-content: center;
   gap: 20px;
   margin-top: 20px;
 }

.nav-buttons .nav-btn {
   width: 60px;
   height: 60px;
   font-size: 30px;
   border-radius: 50%;
   background: #fff;
   border: 1px solid #ccc;
   cursor: pointer;
   transition: transform 0.2s;
 }

.nav-buttons .nav-btn:hover {
   transform: scale(1.1);
   background: #f5f5f5;
 }

#translate-controls {
   text-align: center;
   margin: 15px auto;
   padding: 10px;
   background: #f0f0f0;
   border-radius: 5px;
 }

#translate-controls button {
   padding: 8px 16px;
   margin-right: 10px;
   cursor: pointer;
   background: #4CAF50;
   color: white;
   border: none;
   border-radius: 4px;
 }

#translate-controls button:hover {
   background: #45a049;
 }

 #translate-controls select, #translate-controls input {
    padding: 6px;
    margin: 0 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
  }
  
  .custom-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .custom-alert.success {
    background: #4caf50;
    color: white;
  }
  
  .custom-alert.error {
    background: #f44336;
    color: white;
  }
  
  .custom-alert.info {
    background: #2196f3;
    color: white;
  }
  
  .custom-alert.close-btn {
    cursor: pointer;
    margin-left: auto;
    padding: 4px 8px;
    border-radius: 4px;
  }
  
  .custom-alert.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
  }
  
  @keyframes slideIn {
    from {
      transform: translateX(100%);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  
  @keyframes slideOut {
    from {
      transform: translateX(0);
      opacity: 1;
    }
    to {
      transform: translateX(100%);
      opacity: 0;
    }
  }
  
  .custom-alert.hiding {
    animation: slideOut 0.3s ease-in;
  }
