/* Global styles */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #000000, #373B44);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #fff;
}

/* Main container */
.home, .settings-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  height: 100vh;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  overflow: hidden;
  color: white;
}

/* Video */
.home video {
  position: fixed;
  top: 20px; 
  left: 20px; 
  width: 75px; 
  height: auto; 
  z-index: 10; 
  border-radius: 8px; 
  opacity: 0.1;
}

/* Attributed text main screen */
.attributed {
  position: fixed;
  bottom: 20px;
  right: 80px;
  color: white;
  padding: 16px;
  max-width: 100%;
  text-align: left;
  font-size: 12px;
  z-index: 3;
  width: auto;
}

/* Clock */
.clock {
  position: fixed;
  top: 20px;
  right: 20px;
  font-size: 6rem;
  color: white;
  background-color: rgba(255, 0, 0, 0.2);
  padding: 10px 20px;
  width: 30vw;
  max-width: 300px;
  z-index: 1000;
  text-align: center;
  font-weight: bold;
}

.calendar {
  position: fixed;
  top: 180px;
  right: 20px;
  color: white;
  background-color: rgba(255, 0, 0, 0.2);
  padding: 10px 20px;
  width: 30vw;
  max-width: 300px;
  z-index: 1000;
}

.calendar p {
  position:relative;
  top:0;
  padding: 0;
  margin: 0;
  text-align: center;
  font-size: 2rem;
}

/* Background images */
.background-images, .comic-background-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -1;
}

.comic-background {
  opacity: 0.9;
}


.comic-background-image {
  opacity: 0.1;
  transition: opacity 1s ease-in-out;
  filter: blur(8px);
  background-color: rgba(120, 1, 1, 0.7);
}

.comic-background-image.fadeIn {
  opacity: 0.3;
}

/* Main cover */

.comic-foreground {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  z-index: 2;
}

.comic-foreground.visible {
  animation: slideInOutSimple 5s linear forwards;
}

.comic-img-foreground {
  max-width: 90vw;
  max-height: 100vh;
  object-fit: contain;
}

@keyframes slideInOutSimple {
  0% {
    opacity: 0;
    transform: translateX(-100%);
  }
  10% {
    opacity: 1;
    transform: translateX(0);
  }
  90% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(100%);
  }
}



/* Comic info main screen */
.comic-info {
  position: fixed;
  bottom: 20px;
  left: 20px;
  color: white;
  background-color: rgba(255, 0, 0, 0.2);
  padding: 16px;
  width: 30vw;
  text-align: left;
  z-index: 3;  
  font-size: 2rem;  
}

/* Control buttons */
.controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.controls button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.controls button:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Title style */
.title {
  font-size: 3.5rem;
  font-weight: bold;
  color: white;
  background-color: rgba(255, 0, 0, 0.3);
  padding: 10px 20px;
  width: fit-content;
  margin-bottom: 20px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 90%;
  z-index: 2;
}

.character-section, .date-section, .limit-section {
  padding: 15px;
  border-radius: 8px;
}

.search-group {
  display: flex;
  align-items: center;
}

.button-search {
  background-color: #8c0000;
  color: #fff;
  border: none;
  padding: 10px;
  cursor: pointer;
  margin-top: 6px;
  margin-left: 6px;
}

.character-image {
  margin-top: 12px;
  width: 100%;
  max-width: 300px;
  border-radius: 8px;
}

label, select, input[type="number"], input[type="text"] {
  width: 90%;
  padding: 8px;
  margin-top: 5px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
}

.apply-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #8c0000;
  color: white;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

.apply-button:hover {
  background-color: #690101;
}

/* Loading ring */
.loading-ring-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
}

.loading-ring-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Media Queries smallest devices */
@media (max-width: 768px) {
  .clock {
    font-size: 5rem;
    width: 30vw;
  }
  .comic-info {
    font-size: 0.8rem;
    padding: 12px;
  }
  .controls button {
    width: 40px;
    height: 40px;
  }
  .comic-foreground {
    width: 90%;
    height: auto;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 480px) {
  .clock {
    font-size: 4rem;
    width: 40vw;
  }
  .comic-info {
    font-size: 0.8rem;
    padding: 8px;
  }
  .controls button {
    width: 35px;
    height: 35px;
  }
  .title {
    font-size: 2.5rem;
  }
}

@media (max-width: 960px) and (min-resolution: 150dpi) {
  .clock {
    font-size: 3rem;
    width: 50vw;
    padding: 5px 10px;
  }
  .comic-info {
    font-size: 0.7rem;
    padding: 6px;
    max-width: 80%;
  }
  .controls button {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }
}
