/**
 * Speedix - Styles
 */

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #ff512f 0%, #dd2476 100%);
  min-height: 100vh;
  margin: 0;
  display: flex;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: white;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  z-index: 1000;
}

.sidebar-header {
  padding: 30px 20px;
  border-bottom: 1px solid #eee;
  text-align: center;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
}

.sidebar-username {
  display: block;
  font-size: 1.1em;
  font-weight: 600;
  color: #333;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
}

.sidebar-link {
  display: block;
  padding: 12px 20px;
  color: #666;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
}

.sidebar-link:hover {
  background: #f8f9fa;
  color: #ff512f;
}

.sidebar-link.active {
  background: linear-gradient(90deg, #ff512f 0%, #dd2476 100%);
  color: white;
  border-right: 3px solid #ff512f;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid #eee;
}

.sidebar-logout {
  display: block;
  padding: 12px 20px;
  background: #f8f9fa;
  color: #666;
  text-decoration: none;
  border-radius: 6px;
  text-align: center;
  font-weight: 500;
  transition: all 0.3s ease;
  border: 1px solid #e0e0e0;
}

.sidebar-logout:hover {
  background: #ff512f;
  color: white;
  border-color: #ff512f;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 81, 47, 0.3);
}

/* Main Content */
.main-content {
  margin-left: 250px;
  width: calc(100% - 250px);
  padding: 20px;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* Header */
header {
  background: white;
  color: #333;
  padding: 40px;
  text-align: center;
  border-bottom: 1px solid #eee;
  position: relative;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-bottom: 5px;
}

.logo {
  width: 60px;
  height: 60px;
  /* Pas d'ombre portée sur fond blanc pour garder le style flat/clean */
}

header h1 {
  font-size: 3em;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, #ff512f 0%, #dd2476 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.2em;
  color: #666;
  font-weight: 500;
}

/* Progress Area */
.progress-area {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 2rem;
  margin: 0 40px 20px 40px;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
  color: white;
  animation: slideDown 0.3s ease-out;
}

.progress-header h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.3rem;
  font-weight: 600;
}

.progress-header p {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

.progress-bar-container {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  height: 8px;
  margin: 1.5rem 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  border-radius: 50px;
  transition: width 0.5s ease;
  width: 0%;
}

.progress-steps {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.progress-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  animation: slideIn 0.3s ease;
}

.progress-step-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.progress-step-text {
  flex: 1;
}

.progress-step-time {
  font-size: 0.8rem;
  opacity: 0.7;
  flex-shrink: 0;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Message Area */
.message-area {
  margin: 20px 40px;
  padding: 15px 20px;
  border-radius: 8px;
  font-weight: 500;
  animation: slideDown 0.3s ease-out;
}

.message-area.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message-area.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.message-area.warning {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
  color: #856404;
  border: 2px solid #ffc107;
  border-left: 5px solid #ff9800;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Form Container */
.form-container {
  padding: 40px;
}

/* Form Groups */
.form-group {
  margin-bottom: 25px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #444;
  font-size: 0.95em;
}

.required {
  color: #e74c3c;
  font-weight: bold;
}

input[type="text"],
input[type="url"],
textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1em;
  transition: all 0.3s ease;
  font-family: inherit;
  background-color: white;
}

/* Styles spécifiques pour les select/dropdowns */
select,
select[name="wp_category"],
select[name="wp_status"] {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0 !important;
  border-radius: 8px;
  font-size: 1em;
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: white;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
  color: #333;
  line-height: 1.6;
}

input[type="text"]:focus,
input[type="url"]:focus,
textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select:focus,
select[name="wp_category"]:focus,
select[name="wp_status"]:focus {
  outline: none;
  border-color: #667eea !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select:hover,
select[name="wp_category"]:hover,
select[name="wp_status"]:hover {
  border-color: #667eea !important;
}

input[type="text"]:focus,
input[type="url"]:focus,
textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select:focus,
select[name="wp_category"]:focus,
select[name="wp_status"]:focus {
  outline: none;
  border-color: #667eea !important;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select:hover,
select[name="wp_category"]:hover,
select[name="wp_status"]:hover {
  border-color: #667eea !important;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: 15px 30px;
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #ff512f 0%, #dd2476 100%);
  color: white;
  width: 100%;
  box-shadow: 0 4px 15px rgba(221, 36, 118, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-secondary {
  background: #f8f9fa;
  color: #333;
  border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
  background: #e9ecef;
  border-color: #667eea;
  color: #667eea;
}

/* Button Loader */
.btn-loader {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  animation: rotate 2s linear infinite;
}

.spinner .path {
  stroke: white;
  stroke-linecap: round;
  animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes dash {
  0% {
    stroke-dasharray: 1, 150;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -35;
  }
  100% {
    stroke-dasharray: 90, 150;
    stroke-dashoffset: -124;
  }
}

/* Results Area */
.results-area {
  padding: 40px;
  background: #f8f9fa;
  border-top: 3px solid #667eea;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
}

.results-header h2 {
  color: #333;
  font-size: 1.8em;
}

.results-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-badge {
  padding: 8px 15px;
  background: white;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-badge.success {
  background: #d4edda;
  color: #155724;
}

.stat-badge.error {
  background: #f8d7da;
  color: #721c24;
}

/* Editor Container */
.editor-container {
  margin-bottom: 25px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Results Actions */
.results-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.results-actions button {
  flex: 1;
  min-width: 200px;
}

/* Responsive Design */
@media (max-width: 968px) {
  .sidebar {
    width: 70px;
  }

  .sidebar-header {
    padding: 20px 10px;
  }

  .sidebar-username,
  .sidebar-link span {
    display: none;
  }

  .sidebar-link {
    text-align: center;
    font-size: 1.5em;
  }

  .main-content {
    margin-left: 70px;
    width: calc(100% - 70px);
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }

  .main-content {
    margin-left: 60px;
    width: calc(100% - 60px);
    padding: 10px;
  }

  header {
    padding: 30px 20px;
  }

  header h1 {
    font-size: 2em;
  }

  .form-container,
  .results-area {
    padding: 20px;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .results-actions button {
    width: 100%;
  }
}

/* TinyMCE Overrides */
.tox-tinymce {
  border: none !important;
  border-radius: 8px;
}

.tox .tox-statusbar {
  display: none !important;
}
