/* --- Video Resizer Specific Styles --- */
.tool-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 25px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.tool-container h2 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 2.2em;
}

.tool-description {
  color: #555;
  margin-bottom: 30px;
  font-size: 1.1em;
  line-height: 1.6;
}

.input-group {
  margin-bottom: 20px;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #34495e;
  font-size: 1.05em;
}

input[type="file"] {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #f9f9f9;
  font-size: 1em;
  box-sizing: border-box;
}

input[type="file"]::file-selector-button {
  background-color: #3498db;
  color: white;
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-right: 10px;
  transition: background-color 0.3s ease;
}

input[type="file"]::file-selector-button:hover {
  background-color: #217dbb;
}

.video-preview-area {
  margin-top: 20px;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 15px;
  background-color: #fcfcfc;
  display: none; /* Hidden until video is loaded */
}

.video-wrapper {
  position: relative;
  width: 100%;
  max-height: 400px; /* Limit height for better UI */
  overflow: hidden; /* Hide overflow from video element */
  margin-bottom: 15px;
  background-color: #000; /* Black background for letterboxing */
  display: flex;
  justify-content: center;
  align-items: center;
}

video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  border-radius: 5px;
  margin: 0 auto;
}

.cropping-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px dashed rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5); /* Dimming effect */
  cursor: move;
  box-sizing: border-box;
  display: none; /* Hidden by default */
}

.cropping-overlay.active {
  display: block;
}

.crop-handle {
  position: absolute;
  width: 15px;
  height: 15px;
  background-color: #3498db;
  border: 1px solid white;
  border-radius: 50%;
  cursor: grab;
}
.handle-nw {
  top: -7.5px;
  left: -7.5px;
  cursor: nwse-resize;
}
.handle-ne {
  top: -7.5px;
  right: -7.5px;
  cursor: nesw-resize;
}
.handle-sw {
  bottom: -7.5px;
  left: -7.5px;
  cursor: nesw-resize;
}
.handle-se {
  bottom: -7.5px;
  right: -7.5px;
  cursor: nwse-resize;
}

.resolution-options {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 15px;
  margin-bottom: 20px;
  align-items: center;
  justify-content: center;
}

.resolution-options select {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1em;
  background-color: #f9f9f9;
}

.dimension-inputs {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  justify-content: center;
}

.dimension-inputs div {
  flex: 1;
  text-align: left;
}

.dimension-inputs label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.95em;
}

.dimension-inputs input[type="number"] {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1em;
  box-sizing: border-box;
}

.lock-aspect-ratio {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  font-size: 0.95em;
}

.tool-button {
  background-color: #27ae60;
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1.1em;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin-top: 20px;
  display: inline-block; /* For centering */
}

.tool-button:hover {
  background-color: #229a55;
  transform: translateY(-2px);
}

.tool-button:active {
  transform: translateY(0);
}

.loading-message,
.error-message,
.success-message {
  margin-top: 20px;
  padding: 10px;
  border-radius: 5px;
  font-weight: bold;
  display: none; /* Hidden by default */
  text-align: left;
}

.loading-message {
  background-color: #f0f8ff;
  color: #3498db;
  border: 1px solid #aed6f1;
}

.error-message {
  background-color: #ffebee;
  color: #e74c3c;
  border: 1px solid #ef9a9a;
}

.success-message {
  background-color: #e8f5e9;
  color: #27ae60;
  border: 1px solid #a5d6a7;
}

.download-button {
  background-color: #3498db;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1em;
  margin-top: 15px;
  transition: background-color 0.3s ease;
}

.download-button:hover {
  background-color: #217dbb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .tool-container {
    padding: 15px;
  }
  .dimension-inputs {
    flex-direction: column;
  }
  .resolution-options {
    flex-direction: column;
    align-items: flex-start;
  }
}
