/*
 * Main stylesheet for Traduire.org
 * Optimized for performance and French design aesthetics
 */

/* CSS variables for French color scheme */
:root {
  --bleu-france: #0055A4;
  --blanc: #FFFFFF;
  --rouge-france: #EF4135;
  --primary: #0055A4;
  --secondary: #EF4135;
  --gray-light: #F8F9FA;
  --gray: #E5E7EB;
  --gray-medium: #6B7280;
  --text-dark: #1F2937;
  --text-light: #6B7280;
  --border: #DADCE0;
  --success: #10B981;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Global reset and base styles */
*,
::after,
::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: #F1F3F4;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
  color: var(--text-dark);
}

h1 {
  font-size: 2rem;
  color: var(--primary);
}

h2 {
  font-size: 1.5rem;
  color: var(--primary);
}

h3 {
  font-size: 1.25rem;
  color: var(--text-dark);
}

p {
  margin-bottom: 1rem;
  color: var(--text-light);
}

/* Links */
a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.8;
}

/* Lists */
ul, ol {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 2rem;
  }
}

/* Header styles */
header {
  background: linear-gradient(135deg, var(--bleu-france) 0%, #0066CC 100%);
  color: var(--blanc);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

header a {
  color: var(--blanc);
  text-decoration: none;
  transition: opacity 0.2s;
}

header a:hover {
  opacity: 0.9;
  text-decoration: none;
}

header .logo {
  font-weight: 700;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

header nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

@media (max-width: 768px) {
  header .container {
    flex-direction: column;
    gap: 1rem;
  }

  header nav ul {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  header .logo {
    font-size: 1.25rem;
  }
}

/* Main content */
main {
  flex: 1;
  padding: 2rem 1rem;
}

/* Utility classes */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-grow { flex-grow: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.min-h-screen { min-height: 100vh; }

.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* Spacing utilities */
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-8 { margin-bottom: 2rem; }
.p-4 { padding: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Button styles */
button, .button {
  background-color: var(--primary);
  color: var(--blanc);
  border: none;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

button:hover, .button:hover {
  background-color: #004080;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

button:active, .button:active {
  transform: translateY(0);
}

button:disabled, .button:disabled {
  background-color: var(--gray);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Form elements */
input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 85, 164, 0.1);
}

/* Cards */
.card {
  background: var(--blanc);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

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

/* Grid layouts */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Responsive breakpoints */
@media (min-width: 768px) {
  .md\:text-3xl { font-size: 1.875rem; }
  .md\:text-2xl { font-size: 1.5rem; }
  .md\:text-xl { font-size: 1.25rem; }
}

@media (min-width: 1024px) {
  .lg\:text-4xl { font-size: 2.25rem; }
  .lg\:text-3xl { font-size: 1.875rem; }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

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

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  header, footer, .no-print {
    display: none;
  }

  body {
    background: white;
  }

  .translator-container {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
