/* TestSize Tool Styles */

.input-section {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 24px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}

.url-input-group {
  display: flex;
  gap: 12px;
}

.url-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.url-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.url-hint {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* Toolbar */
.toolbar {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 16px 24px;
  margin-top: 16px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.size-display {
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.95rem;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zoom-display {
  min-width: 50px;
  text-align: center;
  font-weight: 500;
  color: var(--gray-600);
}

.rotate-btn,
.device-frame-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--gray-600);
  transition: all 0.15s;
  user-select: none;
}

.rotate-btn:hover,
.device-frame-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.rotate-btn input,
.device-frame-toggle input {
  display: none;
}

/* Device Tabs */
.device-tabs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* Brand Tabs */
.brand-tabs {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.brand-tab {
  padding: 6px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  background: var(--gray-50);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--gray-600);
  transition: all 0.15s;
  white-space: nowrap;
}

.brand-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eef2ff;
}

.brand-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.device-tab {
  padding: 8px 16px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray-600);
  transition: all 0.15s;
}

.device-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.device-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Device Presets */
.device-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 16px;
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.device-preset {
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  min-width: 100px;
  background: var(--gray-50);
}

.device-preset:hover {
  border-color: var(--primary);
  background: #eef2ff;
}

.device-preset.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.device-preset .device-icon {
  font-size: 1.5rem;
}

.device-preset .device-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.device-preset .device-size {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Custom Size Group */
.custom-size-group {
  margin-top: 12px;
  padding: 16px;
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.custom-inputs {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.custom-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.custom-input label {
  font-size: 0.85rem;
  color: var(--gray-600);
}

.custom-input input {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  width: 120px;
  font-size: 0.9rem;
  outline: none;
}

.custom-input input:focus {
  border-color: var(--primary);
}

.custom-presets-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-preset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.custom-preset-item:hover {
  border-color: var(--primary);
}

.custom-preset-item .remove-btn {
  color: var(--gray-400);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.custom-preset-item .remove-btn:hover {
  color: #ef4444;
}

/* Preview Area */
.preview-area {
  margin-top: 16px;
  padding: 24px;
  background: var(--gray-100);
  border-radius: var(--border-radius);
  min-height: 400px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
}

.iframe-wrapper {
  display: block;
  transition: transform 0.2s;
  transform-origin: top center;
  margin: 0 auto;
}

.device-frame {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: all 0.3s;
  border: 8px solid #1f2937;
  border-radius: 20px;
  margin: 0 auto;
  display: block;
}

.device-frame.no-frame {
  border: none !important;
  border-radius: 0;
  box-shadow: none;
}

.preview-frame {
  display: block;
  background: #fff;
  border: none;
}

.placeholder-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.placeholder-message svg {
  margin-bottom: 16px;
  opacity: 0.5;
}

.placeholder-message p {
  color: var(--gray-500);
  font-size: 1rem;
}

.placeholder-message .hint {
  font-size: 0.85rem;
  margin-top: 8px;
  color: var(--gray-400);
}

/* Keyboard Hints */
.keyboard-hints {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 20px 24px;
  margin-top: 20px;
  box-shadow: var(--shadow);
}

.keyboard-hints h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 12px;
}

.keyboard-hints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.hint-item {
  font-size: 0.85rem;
  color: var(--gray-600);
}

kbd {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  background: var(--gray-50);
  font-family: monospace;
  font-size: 0.85rem;
  box-shadow: 0 1px 0 var(--gray-300);
}

/* Responsive */
@media (max-width: 768px) {
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-left,
  .toolbar-right {
    justify-content: center;
  }

  .url-input-group {
    flex-direction: column;
  }

  .custom-inputs {
    flex-direction: column;
  }

  .custom-input input {
    width: 100%;
  }

  .device-presets {
    justify-content: center;
  }

  .keyboard-hints-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
