/* style.css - Design System & Custom UI styling for RedimensionnementImage.com */

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

:root {
  /* Colors */
  --bg-primary: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #e0e7ff;
  
  --success: #10b981;
  --success-hover: #059669;
  --success-light: #d1fae5;
  
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: #fee2e2;

  --border: #e2e8f0;
  --border-focus: #cbd5e1;

  /* Font Families */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.03), 0 8px 10px -6px rgba(0, 0, 0, 0.03);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

h1 {
  font-size: 2.25rem;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: 1.75rem;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

/* Structure */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Nav */
header {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color var(--transition-fast);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4.5rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo span {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.75rem;
  align-items: center;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  outline: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
  color: white;
}

.btn-secondary {
  background-color: var(--bg-card);
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background-color: var(--bg-primary);
  border-color: var(--border-focus);
}

.btn-danger {
  background-color: var(--danger-light);
  color: var(--danger);
}

.btn-danger:hover {
  background-color: var(--danger);
  color: white;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

/* Translation Button */
.btn-lang {
  background: none;
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.btn-lang:hover {
  background-color: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
}

/* Breadcrumbs */
.breadcrumbs-bar {
  padding: 1rem 0;
  background-color: transparent;
  border-bottom: none;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-muted);
  gap: 0.5rem;
  align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-secondary);
}

.breadcrumbs a:hover {
  color: var(--primary);
}

/* H1 Intro block */
.intro-section {
  padding: 2rem 0 1rem 0;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.intro-section h1 {
  font-size: 2.5rem;
  font-weight: 800;
}

.intro-section p {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* Tool Main Layout */
.tool-wrapper {
  margin-bottom: 4rem;
}

.tool-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Upload Container */
.upload-container {
  padding: 3rem 2rem;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.02), transparent);
}

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background-color: rgba(99, 102, 241, 0.02);
  box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.05);
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: var(--primary);
  margin-bottom: 0.5rem;
  transition: transform var(--transition-normal);
}

.upload-zone:hover .upload-icon {
  transform: translateY(-4px);
}

.upload-zone h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.upload-zone p {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.upload-file-input {
  display: none;
}

/* Tool Workspace - visible after loading images */
.tool-workspace {
  display: grid;
  grid-template-columns: 1fr 380px;
  min-height: 500px;
}

@media (max-width: 992px) {
  .tool-workspace {
    grid-template-columns: 1fr;
  }
}

.workspace-preview {
  padding: 2rem;
  background-color: #fafafa;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-height: 750px;
  overflow-y: auto;
}

.workspace-sidebar {
  padding: 2rem;
  background-color: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  overflow-y: auto;
}

/* Image Item/Card in Batch */
.image-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.image-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  transition: box-shadow var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.image-card:hover {
  box-shadow: var(--shadow-md);
}

.image-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
}

.image-info {
  flex-grow: 1;
  min-width: 0;
}

.image-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.image-meta-grid {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.25rem 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.meta-item {
  display: flex;
  gap: 0.25rem;
}

.meta-label {
  color: var(--text-muted);
}

.meta-val {
  font-weight: 500;
}

.image-card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  padding: 0.25rem;
}

.card-remove-btn:hover {
  color: var(--danger);
}

/* Sidebar Controls */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.control-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Tabs */
.tabs {
  display: flex;
  background-color: var(--bg-primary);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  background-color: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* Forms & Inputs */
.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.input-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-container label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
}

.input-field {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast);
}

.input-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-field[disabled] {
  background-color: var(--bg-primary);
  color: var(--text-muted);
  cursor: not-allowed;
}

.input-unit {
  position: absolute;
  right: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  pointer-events: none;
}

.input-with-unit .input-field {
  padding-right: 2.25rem;
}

/* Aspect Ratio Lock Switch */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.checkbox-container input {
  cursor: pointer;
  accent-color: var(--primary);
  width: 1rem;
  height: 1rem;
}

/* Custom Percentage Presets */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.preset-btn {
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  padding: 0.4rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.preset-btn:hover {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary);
}

.preset-btn.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Slider controls */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.slider-field {
  width: 100%;
  accent-color: var(--primary);
  height: 6px;
  border-radius: 3px;
  background-color: var(--border);
  outline: none;
  cursor: pointer;
}

/* Dropdown styling */
.select-field {
  width: 100%;
  padding: 0.625rem 2rem 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  background-color: var(--bg-card);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  cursor: pointer;
}

.select-field:focus {
  border-color: var(--primary);
}

/* Action button area */
.action-area {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Status Notifications & Errors */
.status-msg {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.status-msg.error {
  background-color: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-msg.success {
  background-color: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-msg.info {
  background-color: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Info panels & SEO text */
.info-section {
  padding: 4rem 0;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.info-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

@media (max-width: 768px) {
  .info-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.seo-rich-text h2 {
  margin-top: 2rem;
}

.seo-rich-text h2:first-child {
  margin-top: 0;
}

.seo-rich-text p {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.seo-rich-text ul {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.seo-rich-text li {
  margin-bottom: 0.5rem;
}

/* FAQ Accordions */
.faq-section {
  margin-top: 3rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--bg-card);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item:hover {
  border-color: var(--border-focus);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  outline: none;
  font-family: var(--font-display);
}

.faq-question::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 400;
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-question::after {
  content: "−";
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal) ease-out;
  background-color: var(--bg-primary);
}

.faq-answer-inner {
  padding: 1.25rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

/* Related Tools cards */
.related-tools-section {
  padding: 4rem 0;
  background-color: var(--bg-primary);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.tool-list-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tool-list-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.tool-list-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.tool-list-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.tool-list-card .btn-tool {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.tool-list-card .btn-tool:hover {
  color: var(--primary-hover);
}

/* Footer styling */
footer {
  background-color: var(--text-primary);
  color: white;
  padding: 4rem 0 2rem 0;
  margin-top: auto;
  border-top: 1px solid #1e293b;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: white;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.footer-logo span {
  color: var(--primary);
}

.footer-about-text {
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: #e2e8f0;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  color: #94a3b8;
  font-size: 0.9rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* Other General Elements */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }

/* Responsive styles */
@media (max-width: 768px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.45rem; }
  .intro-section h1 { font-size: 1.85rem; }
  .intro-section p { font-size: 1rem; }
  
  header {
    position: relative;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 4.5rem;
    left: 0;
    width: 100%;
    background-color: var(--bg-card);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 101;
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .mobile-toggle {
    display: block;
  }
  
  .nav-actions {
    gap: 0.5rem;
  }
  
  .workspace-preview {
    padding: 1rem;
  }
  
  .workspace-sidebar {
    padding: 1.5rem;
  }
  
  .upload-container {
    padding: 2rem 1rem;
  }
}

/* Accessibility settings */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-delay: -1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
