@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

/* ===============================================
   GLOBAL STYLES & MODERN DESIGN
   =============================================== */

* {
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: #fff;
  padding-bottom: 80px;
}

/* Add subtle overlay pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('files/wall.jpg');
  background-size: cover;
  background-attachment: fixed;
  opacity: 0.15;
  z-index: -1;
  pointer-events: none;
}

.container, .container-fluid {
  max-width: 1400px;
}

/* ===============================================
   TYPOGRAPHY
   =============================================== */

.text-gold {
  color: #FFD700 !important;
}

.text-light {
  color: #e0e0e0 !important;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
}

/* ===============================================
   NAVBAR IMPROVEMENTS
   =============================================== */

.navbar {
  background: rgba(0, 0, 0, 0.85) !important;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 15px rgba(255, 215, 0, 0.2);
  padding: 0.75rem 0 !important;
  transition: all 0.3s ease;
}

.navbar.sticky-top {
  border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

/* Navbar container - use flexbox properly */
.navbar .container {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  position: relative;
  flex-wrap: wrap;
}

/* Logo in center - use flex order */
.navbar-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0 !important;
  padding: 0 !important;
  order: 2;
}

/* Navbar toggler on right */
.navbar-toggler {
  margin-left: auto !important;
  order: 3;
  border: 2px solid #FFD700 !important;
}

/* Navbar collapse */
.navbar-collapse {
  order: 4;
  flex-basis: 100%;
  justify-content: flex-end !important;
}

/* On larger screens, position menu items properly */
@media (min-width: 992px) {
  .navbar-collapse {
    flex-basis: auto;
    order: 3;
  }
  
  .navbar-toggler {
    display: none;
  }
}

.logo {
  width: 200px;
  height: auto;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

/* Landing page logo - keep centered on hover */
div.logo a {
  display: inline-block;
  text-align: center;
}

div.logo img:hover {
  transform: scale(1.05);
}

/* Landing page logo wrapper */
div.logo {
  display: flex;
  justify-content: center;
  padding: 2rem 0 1rem;
  margin-bottom: 3rem;
}

/* Landing page container - push down language buttons */
body > .container {
  margin-top: 5rem;
  padding-top: 3rem;
}

/* Larger logo for bigger screens */
@media (min-width: 1400px) {
  .logo {
    width: 250px;
  }
  
  /* More space on larger screens */
  body > .container {
    margin-top: 6rem;
    padding-top: 4rem;
  }
}

@media (min-width: 1920px) {
  .logo {
    width: 280px;
  }
  
  body > .container {
    margin-top: 8rem;
    padding-top: 5rem;
  }
}

.language-switch {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid #FFD700;
  border-radius: 20px;
  padding: 0.5rem 1rem !important;
  color: #FFD700 !important;
  font-weight: 600;
  transition: all 0.3s ease;
}

.language-switch:hover {
  background: #FFD700;
  color: #000 !important;
  transform: translateY(-2px);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path stroke='gold' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/></svg>");
}

/* ===============================================
   BUTTONS - MODERN GOLD THEME
   =============================================== */

.button {
  padding: 10px 20px;
  border-radius: 25px;
  position: relative;
  margin: 10px;
  border: 2px solid #FFD700;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
  font: bold 14px 'Roboto', sans-serif;
  letter-spacing: 1px;
  text-decoration: none;
  color: #000;
  transition: all 0.3s ease;
  display: inline-block;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.6);
  color: #000;
}

.button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

.btn-gold {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  border: none;
  color: #000;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #FFA500 0%, #FFD700 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
  color: #000;
}

.btn-outline-gold {
  border: 2px solid #FFD700;
  color: #FFD700;
  background: transparent;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-outline-gold:hover {
  background: #FFD700;
  color: #000;
  transform: translateY(-2px);
}

.bg-gold {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%) !important;
}

/* ===============================================
   COMIC CARDS - EQUAL SIZE & MODERN DESIGN
   =============================================== */

.series-container {
  margin-top: 2rem;
  margin-bottom: 3rem;
}

.comic-card {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  height: 100%;
}

.comic-card:hover {
  transform: translateY(-10px) scale(1.02);
  border-color: #FFD700;
  box-shadow: 0 15px 40px rgba(255, 215, 0, 0.4);
}

.card-img-wrapper {
  position: relative;
  overflow: hidden;
  height: 350px;
  background: #000;
}

.card-img-top {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.comic-card:hover .card-img-top {
  transform: scale(1.1);
}

.card-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #000;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.card-body {
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.5);
}

.card-title {
  color: #FFD700;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.card-text {
  color: #e0e0e0;
  font-size: 0.95rem;
  line-height: 1.6;
  min-height: 80px;
}

/* Equal card heights */
.row-cols-lg-3 > .col {
  display: flex;
}

.row-cols-md-2 > .col {
  display: flex;
}

.row-cols-1 > .col {
  display: flex;
}

/* ===============================================
   EPISODE SECTIONS
   =============================================== */

.series-details {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  color: #FFD700;
  padding: 2rem;
  border-radius: 15px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  margin-top: 2rem;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}

.yellow {
  color: #FFD700;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.episode {
  color: #FFD700;
  text-align: center;
  margin-bottom: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.episode:hover {
  transform: translateY(-5px);
  border-color: #FFD700;
  box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.episode img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.episode p {
  font-weight: 600;
  margin: 0.5rem 0;
}

.timestamp {
  font-size: 0.85rem;
  color: #aaa;
}

/* ===============================================
   FOOTER
   =============================================== */

footer {
  background: rgba(0, 0, 0, 0.9);
  color: #FFD700;
  padding: 3rem 0 2rem;
  border-top: 2px solid rgba(255, 215, 0, 0.3);
  margin-top: 3rem;
}

.footer-header {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #FFD700;
}

.footer-text {
  font-size: 0.95rem;
  color: #e0e0e0;
  line-height: 1.6;
}

footer input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: #fff;
  padding: 0.75rem;
  border-radius: 5px;
}

footer input::placeholder {
  color: #aaa;
}

footer input:focus {
  outline: none;
  border-color: #FFD700;
  background: rgba(255, 255, 255, 0.15);
}

/* ===============================================
   CHATBOT - SMALLER & MODERN
   =============================================== */

#chatbot-container {
  z-index: 1050;
}

.chat-toggle-btn {
  border-radius: 30px;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid #FFD700;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.chat-toggle-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
}

.chat-btn-text {
  font-size: 0.85rem;
}

#chat-window {
  border-radius: 15px;
  border: 2px solid rgba(255, 215, 0, 0.5);
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#chat-window .card-header {
  font-weight: 700;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.list-group-item.user-msg {
  background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
  border: none;
  color: #fff;
  border-radius: 15px 15px 5px 15px;
  margin: 0.5rem;
  padding: 0.75rem 1rem;
  align-self: flex-end;
  max-width: 80%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.list-group-item.bot-msg {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  color: #000;
  border-radius: 15px 15px 15px 5px;
  margin: 0.5rem;
  padding: 0.75rem 1rem;
  align-self: flex-start;
  max-width: 80%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#chat-messages {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.05);
}

/* ===============================================
   PDF VIEWER
   =============================================== */

#pdf-container {
  position: relative;
  padding: 20px;
  border-radius: 10px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.8);
}

#loading-message {
  color: #FFD700;
  font-size: 1.2rem;
  text-align: center;
  padding: 2rem;
  font-weight: 600;
}

#progress-bar {
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, #FFD700, #FFA500);
  position: fixed;
  top: 0;
  left: 0;
  transition: width 0.3s ease;
  z-index: 9999;
}

.pdf-viewer canvas {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  border-radius: 5px;
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

/* Tablets */
@media (max-width: 992px) {
  .logo {
    width: 180px;
  }
  
  .card-img-wrapper {
    height: 280px;
  }
  
  .card-text {
    font-size: 0.9rem;
    min-height: 70px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  body {
    padding-bottom: 60px;
  }
  
  .logo {
    width: 150px;
  }
  
  .navbar-nav {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }
  
  .button {
    font-size: 12px;
    padding: 8px 15px;
    margin: 5px;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .lead {
    font-size: 1rem;
  }
  
  .card-img-wrapper {
    height: 250px;
  }
  
  .card-title {
    font-size: 1.25rem;
  }
  
  .card-text {
    font-size: 0.85rem;
    min-height: 60px;
  }
  
  .chat-btn-text {
    display: none;
  }
  
  .chat-toggle-btn {
    padding: 0.7rem;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    justify-content: center;
  }
  
  #chat-window {
    width: 90vw !important;
    max-width: 350px;
  }
  
  .episode {
    padding: 0.75rem;
  }
}

/* Small mobile */
@media (max-width: 576px) {
  .series-container {
    gap: 1rem !important;
  }
  
  .card-img-wrapper {
    height: 220px;
  }
  
  .yellow {
    font-size: 1.5rem;
  }
  
  footer {
    padding: 2rem 0 1.5rem;
  }
}

/* ===============================================
   UTILITY CLASSES
   =============================================== */

.transition {
  transition: all 0.3s ease !important;
}

.d-none {
  display: none !important;
}

.shadow-lg {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Loading animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading {
  animation: pulse 1.5s ease-in-out infinite;
}

/* ===============================================
   ACCESSIBILITY
   =============================================== */

*:focus {
  outline: 2px solid #FFD700;
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #FFD700;
  outline-offset: 3px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
