/* Import Google font - Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

:root {
  --primary-color: #3e97fd;
  --secondary-color: #2980b9;
  --text-color: #333;
  --light-text-color: #fff;
  --border-radius: 8px;
  
  /* Gradient colors in RGBA format with 80% opacity */
  --gradient-color-1: rgba(214, 223, 224, 0.8);
  --gradient-color-2: rgba(197, 221, 224, 0.8);
  --gradient-color-3: rgba(191, 209, 211, 0.8);
  --gradient-color-4: rgba(191, 199, 201, 0.8);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  min-height: 100vh;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: linear-gradient(-45deg, var(--gradient-color-1), var(--gradient-color-2), var(--gradient-color-3), var(--gradient-color-4));
  background-size: 400% 400%;
  animation: gradient-animation 15s ease infinite;
}

@keyframes gradient-animation {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#app-logo {
  width: 100%;
  max-width: 900px;
  text-align: center;
  margin-bottom: 20px;
}

#app-logo img {
  width: auto;
  height: 225px;
  transition: transform 0.3s ease;
}

#app-logo:hover img {
  transform: scale(1.05);
}

/* Medium-sized screens */
@media screen and (min-width: 768px) and (max-width: 1199px) {
  #app-logo img {
    height: 350px; /* Increased size for medium screens */
  }
}

/* Large screens */
@media screen and (min-width: 1200px) {
  #app-logo img {
    height: 375px; /* Double the original height for large screens */
  }
}

.file-input-container {
  margin: 20px 0;
  width: 98%;
  max-width: 900px;
  text-align: center;
}

#fileInput {
  display: none;
}

.file-input-label {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: var(--light-text-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.file-input-label:hover {
  background-color: var(--secondary-color);
}

.container {
  width: 98%;
  max-width: 900px;
  user-select: none;
  overflow: hidden;
  border-radius: var(--border-radius);
  background: #000;
  aspect-ratio: 16 / 9;
  position: relative;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.container.fullscreen {
  max-width: 100%;
  width: 100%;
  height: 100vh;
  border-radius: 0;
}

.container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.wrapper {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease, bottom 0.3s ease;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  padding: 10px;
}

.container.show-controls .wrapper {
  opacity: 1;
  bottom: 0;
}

.video-timeline {
  height: 7px;
  width: 100%;
  cursor: pointer;
}

.video-timeline .progress-area {
  height: 3px;
  position: relative;
  background: rgba(255, 255, 255, 0.6);
}

.progress-area .progress-bar {
  width: 0%;
  height: 100%;
  position: absolute;
  background: var(--primary-color);
}

.progress-bar::before {
  content: "";
  right: -6.5px;
  top: 50%;
  height: 13px;
  width: 13px;
  position: absolute;
  border-radius: 50%;
  background: var(--primary-color);
  transform: translateY(-50%);
}

.progress-area span {
  position: absolute;
  left: 50%;
  top: -25px;
  font-size: 13px;
  color: var(--light-text-color);
  pointer-events: none;
  transform: translateX(-50%);
}

.progress-bar::before, .progress-area span {
  display: none;
}

.video-timeline:hover .progress-bar::before,
.video-timeline:hover .progress-area span {
  display: block;
}
.video-controls {
  padding: 5px 20px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.video-controls .options {
  display: flex;
  align-items: center;
}

.options button {
  height: 40px;
  width: 40px;
  font-size: 19px;
  border: none;
  cursor: pointer;
  background: none;
  color: var(--light-text-color);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.options button:hover {
  color: var(--primary-color);
}

.options:where(button, input), .controls button {
  outline: none;
}

.options button:active {
  transform: scale(0.9);
}

.options button span {
  font-size: 23px;
}

.options input[type="range"] {
  height: 4px;
  margin-left: 3px;
  max-width: 75px;
  accent-color: var(--primary-color);
}

.options .video-timer {
  color: var(--light-text-color);
  margin-left: 15px;
  font-size: 14px;
}

.video-timer .separator {
  margin: 0 5px;
  font-size: 16px;
  font-family: "Open sans";
}

.playback-content {
  display: flex;
  position: relative;
}

.playback-content .speed-options {
  position: absolute;
  list-style: none;
  left: -40px;
  bottom: 40px;
  width: 95px;
  overflow: hidden;
  opacity: 0;
  border-radius: 4px;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  transition: opacity 0.13s ease;
}

.playback-content .speed-options.show {
  opacity: 1;
  pointer-events: auto;
}

.speed-options li {
  cursor: pointer;
  color: var(--text-color);
  font-size: 14px;
  margin: 2px 0;
  padding: 5px 0 5px 15px;
  transition: all 0.1s ease;
}

.speed-options li:hover {
  background: #dfdfdf;
}

.speed-options li.active {
  color: var(--light-text-color);
  background: var(--primary-color);
}

/* GIF Controls Styling */
#gifControls {
  background: #fff;
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
  width: 98%;
  max-width: 900px;
  
}

#gifTimelineContainer {
  height: 20px;
  margin: 20px 0;
}

#gifTimelineContainer .noUi-connect {
  background: var(--primary-color);
}

#gifTimelineContainer .noUi-handle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  top: -5px;
  right: -9px;
  cursor: pointer;
}

#gifTimelineContainer .noUi-handle::before,
#gifTimelineContainer .noUi-handle::after {
  display: none;
}

#gifTimelineContainer::before,
#gifTimelineContainer::after {
  content: attr(data-start);
  position: absolute;
  top: 25px;
  font-size: 12px;
}

#gifTimelineContainer::after {
  content: attr(data-end);
  right: 0;
}

#gifResolutionControls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

#gifResolutionControls input {
  width: 48%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

#gifWidth, #gifHeight{
margin-top: 55px;
}
#gifResolutionControls input[type="number"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

#gifResolutionControls input[type="number"]::-webkit-inner-spin-button, 
#gifResolutionControls input[type="number"]::-webkit-outer-spin-button { 
  opacity: 1;
  height: 30px;
}

.resolution-input {
  position: relative;
  width: 48%;
}

.input-description {
  position: absolute;
  left: 8px;
  top: -20px; /* Adjusted to appear above the input */
  font-size: 12px;
  color: #666;
}
.resolution-input {
  position: relative;
  width: 48%;
}

.resolution-input input {
  width: 100%;
  padding: 8px;
  padding-right: 70px; /* Make room for the description */
  border: 1px solid #ddd;
  border-radius: 4px;
}



.input-description {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #666;
}

.recommendation {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
  margin-bottom: 10px;
}

#durationRecommendation{
  font-size: 12px;
  color: #e74c3c;
}

.recommendation.highlight {
  color: #e67e22;
  font-weight: bold;
}

.warning {
  font-size: 12px;
  color: #e74c3c;
  margin-bottom: 10px;
}

#createGifBtn {
  width: 100%;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: var(--light-text-color);
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#createGifBtn:hover {
  background-color: var(--secondary-color);
}

#gifResult {
  margin-top: 20px;
  text-align: center;
  width: 98%;
  max-width: 900px;
}

/* Progress Indicator Styles */
#gifProgressContainer {
  margin-top: 20px;
  text-align: center;
}

.progress-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #ededed;
  margin: 0 auto 15px;
}

.progress-circle-bar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: background 0.3s ease;
}

.progress-circle-value {
  font-size: 18px;
  color: var(--primary-color);
}

.progress-status {
  font-size: 14px;
  color: var(--text-color);
}

#gifResult img {
  max-width: 100%;
  border-radius: var(--border-radius);
}

.download-button {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: var(--light-text-color);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: background-color 0.3s;
}

.download-button:hover {
  background-color: var(--secondary-color);
}

@media screen and (max-width: 768px) {
  .container, #gifControls, .file-input-container, #gifResult {
    width: 95%;
  }
  
  .wrapper .video-controls {
    padding: 3px 10px 7px;
  }
  
  .options input[type="range"], .progress-area span {
    display: none !important;
  }
  
  .options button {
    height: 30px;
    width: 30px;
    font-size: 17px;
  }
  
  .options .video-timer {
    margin-left: 5px;
  }
  
  .video-timer .separator {
    font-size: 14px;
    margin: 0 2px;
  }
  
  .options button span {
    font-size: 21px;
  }
  
  .options .video-timer, .progress-area span, .speed-options li {
    font-size: 12px;
  }
  
  .playback-content .speed-options {
    width: 75px;
    left: -30px;
    bottom: 30px;
  }
  
  .speed-options li {
    margin: 1px 0;
    padding: 3px 0 3px 10px;
  }
}

