/* CaptureAny - Professional Cross-Platform Screenshot Engine */
:root {
  --bg-dark: #121316;
  --bg-card: #1c1d22;
  --bg-toolbar: rgba(26, 27, 34, 0.94);
  --border-color: rgba(255, 255, 255, 0.12);
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59, 130, 246, 0.4);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --danger-color: #ef4444;
  --success-color: #10b981;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --handle-size: 8px;
  --toolbar-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  font-family: var(--font-family);
  color: var(--text-main);
  touch-action: none;
}

.app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* -------------------------------------------------------------
   Start Screen / Launcher UI
------------------------------------------------------------- */
.start-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 20%, #1e2230 0%, #0d0e12 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10;
}

.top-nav-bar {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 10px;
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  backdrop-filter: blur(8px);
}

.nav-icon-btn svg {
  width: 16px;
  height: 16px;
  color: #60a5fa;
}

.nav-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.feedback-nav-btn svg {
  color: #fbbf24;
}

.brand-header {
  text-align: center;
  margin-bottom: 28px;
}


.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #0f1117;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.25);
  margin-bottom: 16px;
}
.ca-brand-svg {
  width: 48px;
  height: 48px;
}

/* legacy */
.old-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.35);
  margin-bottom: 16px;
}

.logo-badge svg {
  width: 36px;
  height: 36px;
  color: #fff;
}

.brand-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.brand-header h1 span {
  color: var(--accent-color);
  font-weight: 800;
}

.tagline {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 520px;
  line-height: 1.5;
}

.action-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}

.action-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 15px 18px;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  background: #23252d;
}

.action-card.primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(59, 130, 246, 0.15));
  border-color: rgba(99, 102, 241, 0.4);
}

.action-card.primary:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(59, 130, 246, 0.25));
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.25);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  margin-right: 14px;
  flex-shrink: 0;
}

.card-icon svg {
  width: 22px;
  height: 22px;
  color: var(--accent-color);
}

.card-text {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-text strong {
  font-size: 1rem;
  margin-bottom: 2px;
}

.card-text span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.hotkey-pill {
  font-size: 0.72rem;
  font-family: ui-monospace, Menlo, Monaco, monospace;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.platform-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
  justify-content: center;
}

.platform-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.platform-badge.active {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.25);
  background: rgba(56, 189, 248, 0.08);
}

/* -------------------------------------------------------------
   Active Capture Viewport & Canvas
------------------------------------------------------------- */
.viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  cursor: crosshair;
}

canvas#screenshot-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.dimension-badge {
  position: absolute;
  background: rgba(18, 19, 24, 0.88);
  color: #fff;
  font-size: 12px;
  font-family: ui-monospace, Menlo, Monaco, monospace;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 50;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transform: translateY(-100%);
  margin-top: -6px;
  white-space: nowrap;
}

/* Text Editor & Floating Options Toolbar */
.text-editor {
  position: absolute;
  min-width: 80px;
  min-height: 28px;
  border: 1px dashed #3b82f6;
  background: rgba(0, 0, 0, 0.4);
  color: #ff2a2a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  padding: 4px 8px;
  outline: none;
  z-index: 60;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.text-options-bar {
  position: absolute;
  background: var(--bg-toolbar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  box-shadow: var(--toolbar-shadow);
  border-radius: 8px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 65;
}

.text-options-bar select {
  background: #1e1e24;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

.text-opt-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-opt-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.text-opt-btn.active {
  background: var(--accent-color);
  color: #fff;
}

.pill-preview {
  display: inline-block;
  background: #fff;
  color: #121316;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
}

/* -------------------------------------------------------------
   Dual Floating Toolbars
------------------------------------------------------------- */
.toolbar {
  position: absolute;
  background: var(--bg-toolbar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  box-shadow: var(--toolbar-shadow);
  z-index: 70;
  display: flex;
  transition: opacity 0.12s ease;
}

.vertical-toolbar {
  flex-direction: column;
  padding: 4px;
  border-radius: 8px;
  gap: 3px;
}

.horizontal-toolbar {
  flex-direction: row;
  padding: 4px;
  border-radius: 8px;
  gap: 3px;
  align-items: center;
}

.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: #d1d5db;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-btn svg {
  width: 18px;
  height: 18px;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: scale(1.05);
}

.tool-btn:active {
  transform: scale(0.95);
}

.tool-btn.active {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}

.tool-btn.primary-action:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
}

.tool-btn.close-action:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.tool-btn.action-upload:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.tool-btn.feedback-action:hover {
  background: rgba(251, 191, 36, 0.25);
  color: #fcd34d;
}

.toolbar-divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 3px 0;
}

.toolbar-divider.horizontal {
  width: 1px;
  height: 22px;
  margin: 0 4px;
}

/* -------------------------------------------------------------
   Shapes Submenu & Flyout Palette
------------------------------------------------------------- */
.shape-menu-wrapper {
  position: relative;
}

.shapes-flyout {
  position: absolute;
  left: 42px;
  top: -8px;
  background: var(--bg-toolbar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  box-shadow: var(--toolbar-shadow);
  border-radius: 10px;
  padding: 8px;
  width: 180px;
  z-index: 85;
  animation: flyoutIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes flyoutIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}

.flyout-header {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 6px;
  padding-left: 2px;
}

.flyout-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.shape-opt-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.shape-opt-btn svg {
  width: 14px;
  height: 14px;
  color: #38bdf8;
}

.shape-opt-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(99, 102, 241, 0.4);
}

.shape-opt-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-hover);
  color: #fff;
}
.shape-opt-btn.active svg {
  color: #fff;
}

/* -------------------------------------------------------------
   Color Picker & Native OS Trigger
------------------------------------------------------------- */
.color-preview-btn {
  position: relative;
}

.color-dot {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}

.color-preview-btn:hover .color-dot {
  transform: scale(1.15);
}

.hidden-native-color-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* -------------------------------------------------------------
   Modal Dialogs (Cloud, Cloud Settings, Feedback)
------------------------------------------------------------- */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-box {
  background: #1c1e24;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h3 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.modal-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}

.close-modal-btn:hover {
  color: #fff;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.folder-path-badge {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #93c5fd;
}

.folder-path-badge strong {
  color: #fff;
}

.upload-preview-wrap {
  width: 100%;
  max-height: 180px;
  overflow: hidden;
  border-radius: 8px;
  background: #101114;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.upload-preview-wrap img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.link-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.link-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-button input {
  flex-grow: 1;
  background: #121316;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 14px;
  color: #60a5fa;
  font-family: ui-monospace, Menlo, Monaco, monospace;
  font-size: 0.9rem;
  outline: none;
}

.input-with-button button {
  background: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.input-with-button button:hover {
  background: var(--accent-hover);
}

.cloud-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.modal-btn {
  flex: 1;
  text-align: center;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal-btn.primary {
  background: #2563eb;
  border-color: #3b82f6;
}

.modal-btn.primary:hover {
  background: #1d4ed8;
}

/* -------------------------------------------------------------
   Cloud Storage Configuration Modal Styles
------------------------------------------------------------- */
.cloud-settings-box {
  max-width: 520px;
}

.storage-providers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.provider-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.provider-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(99, 102, 241, 0.4);
}

.provider-card.active {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.provider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.provider-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}

.provider-info {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.provider-info strong {
  font-size: 0.95rem;
}

.provider-info span, .provider-info code {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.provider-info code {
  color: #93c5fd;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 4px;
  border-radius: 3px;
}

.btn-connect {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-connect:hover {
  background: var(--accent-color);
  border-color: var(--accent-hover);
}

.badge-connected {
  color: #34d399;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 8px;
  background: rgba(16, 185, 129, 0.15);
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-active {
  color: #60a5fa;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 8px;
  background: rgba(59, 130, 246, 0.15);
  border-radius: 6px;
}

/* -------------------------------------------------------------
   Feedback Modal Styles (!)
------------------------------------------------------------- */
.feedback-box {
  max-width: 460px;
}

.feedback-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feedback-field label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.star-rating {
  display: flex;
  gap: 6px;
  font-size: 1.8rem;
  cursor: pointer;
}

.star {
  color: #4b5563;
  transition: color 0.15s ease, transform 0.1s ease;
}

.star:hover, .star.active {
  color: #fbbf24;
  transform: scale(1.1);
}

.feedback-field select, .feedback-field textarea {
  background: #121316;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

.feedback-field select:focus, .feedback-field textarea:focus {
  border-color: var(--accent-color);
}

.feedback-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* -------------------------------------------------------------
   Toast Notification
------------------------------------------------------------- */
.toast {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 19, 24, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 30px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  z-index: 200;
  backdrop-filter: blur(12px);
  pointer-events: none;
  animation: toastFade 0.25s ease;
}

@keyframes toastFade {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
