/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5;
  background-color: #fff;
  color: rgba(0, 0, 0, 0.87);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Container */
.container {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* Header */
.header {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px;
  border-bottom: 1px solid #eee;
}

.header-title {
  font-family: inherit;
  font-weight: 700;
  font-size: 20px;
  margin: 0;
}

.header-link {
  color: inherit;
  text-decoration: none;
}

.header-link:hover {
  text-decoration: none;
}

.header-content {
  padding-left: 32px;
  padding-right: 32px;
}

.header-tagline {
  font-size: 16px;
  color: rgba(0, 0, 0, 0.6);
  opacity: 0.9;
  margin-bottom: 2rem;
}

/* Main Content */
.main {
  flex: 1;
  background-color: #fff;
}

.main-content {
  border-radius: 16px;
  overflow: hidden;
}

.form-section {
  padding: 32px;
  border-color: rgba(0, 0, 0, 0.12);
}

/* URL Input Area */
.url-input-area {
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  background-color: #f4f4f4;
}

.form-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* Text Field */
.text-field {
  display: inline-flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 500px;
  background-color: #fff;
  border-radius: 4px;
  border: 1px solid #ccc;
}

.input-container {
  font-family: inherit;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.4375em;
  color: rgba(0, 0, 0, 0.87);
  box-sizing: border-box;
  position: relative;
  cursor: text;
  display: inline-flex;
  align-items: center;
  width: 100%;
  border-radius: 4px;
}

.input {
  font: inherit;
  letter-spacing: inherit;
  color: currentColor;
  padding: 16.5px 14px;
  border: 0;
  box-sizing: content-box;
  background: none;
  height: 1.4375em;
  margin: 0;
  display: block;
  min-width: 0;
  width: 100%;
}

.input:focus {
  outline: 0;
}

.input::placeholder {
  color: currentColor;
  opacity: 0.42;
}

.input-outline {
  text-align: left;
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  margin: 0;
  padding: 0 8px;
  pointer-events: none;
  border-radius: inherit;
  border-style: solid;
  border-width: 1px;
  overflow: hidden;
  min-width: 0%;
}

/* Button */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
  background-color: transparent;
  outline: 0;
  border: 0;
  margin: 0;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  user-select: none;
  vertical-align: middle;
  appearance: none;
  text-decoration: none;
  color: inherit;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.75;
  text-transform: uppercase;
  min-width: 64px;
  padding: 6px 16px;
  border-radius: 4px;
  transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
    box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
    border-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
  color: #fff;
  background-color: #333;
  box-shadow: none;
  padding: 12px 32px;
  border-radius: 8px;
  text-transform: none;
  font-weight: 600;
  outline: none;
}

.button:hover {
  text-decoration: none;
  background-color: #666;
  box-shadow: none;
}

.button:disabled {
  color: rgba(0, 0, 0, 0.26);
  box-shadow: none;
  background-color: rgba(0, 0, 0, 0.12);
  cursor: not-allowed;
}

/* Header menu trigger */
.menu-button {
  background: transparent;
  border: 1px solid #ddd;
  color: #333;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.menu-button:hover {
  background: #f3f3f3;
}

/* Settings */
.settings {
  display: flex;
  gap: 32px;
  margin-top: 16px;
}

.setting-group {
  flex: 1;
  padding: 24px;
  height: 100%;
  background-color: white;
  border-radius: 12px;
  border: 1px solid #ccc;
}

.setting-title {
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.6;
  margin-bottom: 0.35em;
  font-weight: 600;
}

/* Slider */
.slider-container {
  padding-left: 16px;
  padding-right: 16px;
  margin-top: 24px;
}

.slider-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.speed-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e9ecef;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
  box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14),
    0px 1px 5px 0px rgba(0, 0, 0, 0.12);
  transition: box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}

.speed-slider::-webkit-slider-thumb:hover {
  box-shadow: 0px 0px 0px 8px rgba(51, 51, 51, 0.16), 0px 3px 1px -2px rgba(0, 0, 0, 0.2),
    0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
}

.speed-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #333;
  cursor: pointer;
  border: none;
  box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14),
    0px 1px 5px 0px rgba(0, 0, 0, 0.12);
  transition: box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}

.speed-slider::-moz-range-thumb:hover {
  box-shadow: 0px 0px 0px 8px rgba(51, 51, 51, 0.16), 0px 3px 1px -2px rgba(0, 0, 0, 0.2),
    0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
}

.speed-slider::-moz-range-track {
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  border: none;
}

.speed-slider:focus {
  outline: none;
}

.speed-slider:focus::-webkit-slider-thumb {
  box-shadow: 0px 0px 0px 8px rgba(51, 51, 51, 0.16), 0px 3px 1px -2px rgba(0, 0, 0, 0.2),
    0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
}

.slider-value {
  font-weight: 600;
  color: #999;
  font-size: 1.1rem;
  text-align: center;
}

/* Width Input */
.width-input-container {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
}

.width-input-field {
  width: 120px;
  border-radius: 4px;
  border: 1px solid #ccc;
  padding-right: 10px;
}

.width-input-field .input-outline {
  border-radius: 8px;
}

.input-label {
  color: rgba(0, 0, 0, 0.6);
  font-family: inherit;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.4375em;
  padding: 0;
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(14px, 16px) scale(1);
  max-width: calc(100% - 24px);
  user-select: none;
  pointer-events: auto;
  transform: translate(14px, -9px) scale(0.75);
  max-width: calc(133% - 32px);
  transition: color 200ms cubic-bezier(0, 0, 0.2, 1) 0ms,
    transform 200ms cubic-bezier(0, 0, 0.2, 1) 0ms, max-width 200ms cubic-bezier(0, 0, 0.2, 1) 0ms;
  z-index: 1;
}

.input-adornment {
  display: flex;
  max-height: 2em;
  align-items: center;
  white-space: nowrap;
  color: rgba(0, 0, 0, 0.54);
  margin-left: 8px;
}

.input-adornment-text {
  font-weight: 600;
  color: rgba(0, 0, 0, 0.6);
}

.width-input {
  text-align: center;
  padding-right: 0;
}

.width-input-container .input-outline legend {
  max-width: 100%;
  transition: max-width 100ms cubic-bezier(0, 0, 0.2, 1) 50ms;
}

.width-input-container .input-outline legend span {
  padding-left: 5px;
  padding-right: 5px;
  display: inline-block;
  opacity: 0;
  visibility: visible;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 32px;
  border-top: 1px solid #eee;
  font-size: 14px;
  color: #999;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-link {
  color: #999;
  text-decoration: none;
}

.footer-link:hover {
  color: #333;
  text-decoration: underline;
}

.footer-copyright {
  font-size: 12px;
  font-weight: 400;
}

/* Carousel Styles */
.carousel-container {
  position: relative;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 50px 0;
}

.carousel-wrapper {
  overflow: hidden;
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  padding: 40px 0;
  margin: 0 auto;
}

.carousel-track {
  display: flex;
  align-items: center;
  transition: none;
}

.carousel-item {
  flex-shrink: 0;
  margin: 0;
}

.carousel-item img {
  display: block;
  width: 100%;
  height: auto;
}

/* Embed Section */
.embed-section {
  padding: 30px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

.embed-container {
  background: white;
  border-radius: 15px;
  padding: 25px;
}

.embed-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.embed-code {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: #666;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.copy-btn {
  background: #333;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.copy-btn:hover {
  background: #666;
}

.copy-btn.copied {
  background: #333;
}

/* Error Message */
.error-message {
  color: #ff4757;
  font-size: 0.9rem;
  margin-top: 10px;
  padding: 10px;
  background: rgba(255, 71, 87, 0.1);
  border-radius: 5px;
  display: none;
}

/* Responsive Design */
@media (max-width: 840px) {
  .header-nav {
    padding: 16px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-title {
    font-size: 20px;
  }

  .header-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .form-container {
    flex-direction: column;
  }

  .settings {
    flex-direction: column;
  }

  .setting-group {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
}

/* Utility Classes */
.hidden {
  display: none;
}

.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Right Drawer */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  z-index: 9998;
  opacity: 0;
  transition: opacity 200ms ease;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100dvh; /* requested */
  width: 320px;
  max-width: 90vw;
  background: #fff;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 240ms ease;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-overlay.open {
  opacity: 1;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #eee;
}

.drawer-title {
  font-size: 16px;
  font-weight: 700;
}

.drawer-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #666;
}

.drawer-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.drawer-item a {
  display: block;
  padding: 14px 16px;
  color: #333;
  text-decoration: none;
}

.drawer-item a:hover {
  background: #f6f6f6;
}
