@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  --bg-dark: #0a0b0e;
  --bg-card: #12141a;
  --bg-card-hover: #181b24;
  --bg-input: #1a1d26;
  --border-color: #242834;
  --border-focus: #ccff00;
  
  --accent-acid: #ccff00;
  --accent-acid-glow: rgba(204, 255, 0, 0.25);
  --accent-acid-dim: #99cc00;
  --accent-text: #0a0b0e;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-acid-glow);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Header Navbar */
header {
  background: rgba(18, 20, 26, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
  gap: 12px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon-img {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: var(--shadow-glow);
}

.logo-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-coffee {
  background: rgba(255, 221, 0, 0.12);
  color: #ffdd00;
  border: 1px solid rgba(255, 221, 0, 0.3);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-coffee:hover {
  background: rgba(255, 221, 0, 0.25);
  box-shadow: 0 0 15px rgba(255, 221, 0, 0.3);
  transform: translateY(-1px);
}

.btn-github {
  background: var(--bg-input);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-github:hover {
  border-color: var(--accent-acid);
  color: var(--accent-acid);
  box-shadow: var(--shadow-glow);
}

.btn-lang {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-lang:hover {
  border-color: var(--accent-acid);
  color: var(--accent-acid);
  box-shadow: var(--shadow-glow);
}

.btn-sample {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-sample:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-acid);
  color: var(--accent-acid);
}

/* App Main Responsive Layout Grid */
.app-container {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(320px, 1fr) minmax(320px, 380px);
  gap: 20px;
  padding: 20px;
  flex: 1;
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 1280px) {
  .app-container {
    grid-template-columns: 280px 1fr 320px;
    gap: 16px;
    padding: 16px;
  }
}

@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "workspace workspace"
      "controls previews";
  }

  .workspace-panel {
    grid-area: workspace;
    min-height: 420px;
  }
  .panel-left {
    grid-area: controls;
  }
  .panel-right {
    grid-area: previews;
  }
}

@media (max-width: 768px) {
  header {
    padding: 10px 14px;
  }

  .logo-title {
    font-size: 18px;
  }

  .btn-sample {
    padding: 6px 12px;
    font-size: 12px;
  }

  .app-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 12px;
  }

  .workspace-panel {
    order: 1;
    min-height: 320px;
    padding: 14px 10px;
  }

  .panel-left {
    order: 2;
  }

  .panel-right {
    order: 3;
  }

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

/* Panels */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-main);
  height: fit-content;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.panel-title svg {
  color: var(--accent-acid);
}

/* Accordion Component for Épuré Left Panel */
.accordion-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.2s ease;
}

.accordion-item[open] {
  border-color: rgba(204, 255, 0, 0.3);
}

.accordion-header {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  list-style: none;
}

.accordion-header::-webkit-details-marker {
  display: none;
}

.accordion-header .chevron {
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

.accordion-item[open] .accordion-header .chevron {
  transform: rotate(180deg);
  color: var(--accent-acid);
}

.accordion-content {
  padding: 10px 12px 14px;
  border-top: 1px solid var(--border-color);
}

/* Section Group */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-label-value {
  color: var(--accent-acid);
  font-family: monospace;
  font-size: 12px;
}

/* Upload Dropzone */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 14px;
  text-align: center;
  background: rgba(26, 29, 38, 0.5);
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-acid);
  background: rgba(204, 255, 0, 0.04);
  box-shadow: inset 0 0 15px rgba(204, 255, 0, 0.08);
}

.dropzone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  background: rgba(204, 255, 0, 0.1);
  color: var(--accent-acid);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 18px;
}

.dropzone-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.dropzone-subtext {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Effects Options Styling */
.fx-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fx-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

.fx-toggle input[type="checkbox"] {
  accent-color: var(--accent-acid);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Range Sliders */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-card);
  border-radius: 4px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-acid);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-acid);
  transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Shape Grid Selector */
.shape-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.shape-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 10px;
  font-weight: 600;
}

.shape-btn:hover {
  border-color: rgba(204, 255, 0, 0.4);
  color: var(--text-main);
}

.shape-btn.active {
  border-color: var(--accent-acid);
  background: rgba(204, 255, 0, 0.08);
  color: var(--accent-acid);
  box-shadow: var(--shadow-glow);
}

.shape-preview-icon {
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
}

.shape-preview-icon.squircle {
  border-radius: 25%;
}

.shape-preview-icon.rounded {
  border-radius: 5px;
}

.shape-preview-icon.circle {
  border-radius: 50%;
}

.shape-preview-icon.macos {
  border-radius: 22%;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.4);
}

.shape-preview-icon.square {
  border-radius: 0;
}

/* Center Workspace / Responsive Canvas Cropper */
.workspace-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 480px;
  background: #08090c;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
  padding: 20px;
}

.workspace-toolbar {
  position: absolute;
  top: 14px;
  display: flex;
  gap: 8px;
  background: rgba(18, 20, 26, 0.85);
  backdrop-filter: blur(12px);
  padding: 6px 14px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  z-index: 10;
  max-width: 90%;
  text-align: center;
}

/* Fully Responsive Canvas Viewport */
.canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 40px rgba(204, 255, 0, 0.08);
  cursor: grab;
  user-select: none;
  touch-action: none;
  background-image: 
    linear-gradient(45deg, #181a22 25%, transparent 25%), 
    linear-gradient(-45deg, #181a22 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #181a22 75%), 
    linear-gradient(-45deg, transparent 75%, #181a22 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  margin: 36px 0 24px;
}

.canvas-wrapper:active {
  cursor: grabbing;
}

#cropCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.crop-hint {
  position: absolute;
  bottom: 14px;
  background: rgba(10, 11, 14, 0.75);
  backdrop-filter: blur(8px);
  color: var(--text-muted);
  font-size: 11px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}

/* Right Panel: Previews & Export Options */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.preview-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.preview-card-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

/* Mockups */
.mockup-ios {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.5);
  object-fit: cover;
}

.mockup-mac {
  width: 64px;
  height: 64px;
  object-fit: cover;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.6));
}

.mockup-android {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
  object-fit: cover;
}

.mockup-web {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #2a2d3a;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  color: #ccc;
  max-width: 100%;
}

.mockup-favicon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Checkbox Section */
.export-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-item:hover {
  border-color: rgba(204, 255, 0, 0.4);
}

.checkbox-item input[type="checkbox"] {
  accent-color: var(--accent-acid);
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-label {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.checkbox-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.checkbox-desc {
  font-size: 10px;
  color: var(--text-dim);
}

/* Action Buttons */
.btn-export-acid {
  background: var(--accent-acid);
  color: var(--accent-text);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-glow);
  transition: all 0.25s ease;
  width: 100%;
}

.btn-export-acid:hover {
  background: #d4ff1a;
  transform: translateY(-2px);
  box-shadow: 0 0 30px var(--accent-acid-glow);
}

.btn-export-acid:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary:hover {
  border-color: var(--accent-acid);
  color: var(--accent-acid);
}

/* Modal Popup for Code Snippets */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 11, 14, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  box-shadow: var(--shadow-main), var(--shadow-glow);
  overflow: hidden;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

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

.btn-close:hover {
  color: var(--accent-acid);
}

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

.modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.tab-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  border-color: var(--accent-acid);
  background: rgba(204, 255, 0, 0.1);
  color: var(--accent-acid);
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.tab-content.active {
  display: flex;
}

pre {
  background: #060709;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px;
  overflow-x: auto;
  font-family: monospace;
  font-size: 12px;
  color: #a3e635;
  max-height: 260px;
}

.btn-copy {
  background: var(--accent-acid);
  color: var(--accent-text);
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  align-self: flex-end;
}

.btn-copy:hover {
  background: #d4ff1a;
  box-shadow: var(--shadow-glow);
}
