/* Base styles */
:root {
  --primary-color: #0088ff;
  --primary-dark: #0066cc;
  --text-color: #333333;
  --bg-color: #ffffff;
  --card-bg: #ffffff;
  --section-bg: #f8f9fa;
  --border-color: #e0e0e0;
  --hover-bg: #f0f7ff;
  --secondary-bg: #f0f0f0;
  --input-bg: #ffffff;
  --footer-bg: #2c3e50;
  --footer-text: #ffffff;
  --success-color: #28a745;
  --error-color: #dc3545;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.3;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
}

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

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

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn.primary:hover {
  background-color: var(--primary-dark);
}

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

.btn.secondary:hover {
  background-color: #e0e0e0;
}

/* Header */
.header {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  background-color: var(--bg-color);
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  margin-right: 10px;
}

.logo h1 {
  font-size: 1.5rem;
  margin-bottom: 0;
}

.nav-links {
  display: flex;
  align-items: center;
}

.nav-link {
  margin-left: 20px;
  color: var(--text-color);
  font-weight: 500;
}

.nav-link:hover {
  color: var(--primary-color);
}

#theme-toggle {
  margin-left: 20px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 50%;
  transition: background-color 0.2s;
}

#theme-toggle:hover {
  background-color: var(--hover-bg);
}

/* Hero section */
.hero {
  padding: 3rem 0;
  text-align: center;
  background-color: var(--section-bg);
}

.hero h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.25rem;
  max-width: 800px;
  margin: 0 auto 1rem;
}

.hero .subtitle {
  font-size: 1rem;
  color: #666;
}

/* Converter section */
.converter {
  padding: 3rem 0;
}

.converter-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 2rem;
}

.steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  right: -50%;
  width: 100%;
  height: 2px;
  background-color: var(--border-color);
  z-index: 0;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--secondary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.step.active .step-number {
  background-color: var(--primary-color);
  color: white;
}

.step-text {
  font-weight: 500;
}

.converter-flex-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 2rem;
}

.upload-area {
  flex: 1;
  min-width: 300px;
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.2s;
  cursor: pointer;
}

.upload-area.drag-over {
  border-color: var(--primary-color);
  background-color: var(--hover-bg);
}

.upload-icon {
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.upload-info {
  font-size: 0.875rem;
  color: #666;
  margin-top: 1rem;
}

.conversion-options {
  flex: 1;
  min-width: 300px;
  padding: 1rem;
  background-color: var(--section-bg);
  border-radius: 8px;
}

.format-selection, .quality-slider {
  margin-bottom: 1.5rem;
}

.format-selection label, .quality-slider label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

select, input[type="range"] {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: var(--input-bg);
}

.conversion-options .btn {
  margin-right: 10px;
  margin-bottom: 10px;
}

.preview-area, .results-area {
  margin-top: 2rem;
}

.preview-container, .results-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 1rem;
}

.preview-item, .result-item {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.preview-item img, .result-item img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  background-color: #f5f5f5;
}

.file-name {
  padding: 10px;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-color: var(--card-bg);
}

.download-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.download-btn:hover {
  background-color: var(--primary-dark);
}

.download-text-btn {
  margin-top: 10px;
  width: 100%;
  border-radius: 0 0 8px 8px;
}

/* Features section */
.features {
  padding: 3rem 0;
  background-color: var(--section-bg);
}

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

.feature {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* Formats section */
.formats {
  padding: 3rem 0;
}

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

.format-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
}

.format-card:hover {
  transform: translateY(-5px);
}

/* Format comparison section */
.format-comparison {
  padding: 3rem 0;
  background-color: var(--section-bg);
}

.table-responsive {
  overflow-x: auto;
  margin-top: 2rem;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
}

.comparison-table th, .comparison-table td {
  padding: 12px 15px;
  border: 1px solid var(--border-color);
}

.comparison-table th {
  background-color: var(--primary-color);
  color: white;
}

.comparison-table tr:nth-child(even) {
  background-color: var(--hover-bg);
}

.check {
  color: var(--success-color);
  font-weight: bold;
}

.cross {
  color: var(--error-color);
  font-weight: bold;
}

/* How-to section */
.how-to {
  padding: 3rem 0;
}

.steps-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 2rem;
}

.step-card {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  position: relative;
}

.step-card .step-number {
  position: absolute;
  top: -20px;
  left: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* FAQ section */
.faq {
  padding: 3rem 0;
  background-color: var(--section-bg);
}

.accordion {
  margin-top: 2rem;
}

.accordion-item {
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.accordion-header {
  width: 100%;
  padding: 15px 20px;
  background-color: var(--card-bg);
  border: none;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-header::after {
  content: '+';
  font-size: 1.5rem;
}

.accordion-header.active::after {
  content: '-';
}

.accordion-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease;
}

.accordion-content.active {
  padding: 15px 20px;
  max-height: 500px;
}

/* Privacy and Terms sections */
.policy-section {
  padding: 3rem 0;
}

.policy-section h2 {
  margin-bottom: 0.5rem;
}

.last-updated {
  color: #666;
  font-style: italic;
  margin-bottom: 2rem;
}

.policy-content {
  background-color: var(--card-bg);
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.policy-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.policy-content ul {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.policy-content p {
  margin-bottom: 1rem;
}

/* Footer */
.footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 3rem 0 1.5rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
}

.footer-logo img {
  margin-right: 10px;
}

.footer-links {
  display: flex;
}

.footer-link {
  margin-left: 20px;
  color: var(--footer-text);
}

.footer-link:hover {
  color: var(--primary-color);
}

.copyright {
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Responsive styles */
@media (max-width: 768px) {
  .header .container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .nav-links {
    margin-top: 1rem;
  }
  
  .nav-link {
    margin-left: 0;
    margin-right: 20px;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    margin-top: 1rem;
  }
  
  .footer-link {
    margin: 0 10px;
  }
}

@media (max-width: 576px) {
  .steps {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .step {
    margin-bottom: 1rem;
    flex-direction: row;
    width: 100%;
  }
  
  .step-number {
    margin-right: 10px;
    margin-bottom: 0;
  }
  
  .step:not(:last-child)::after {
    display: none;
  }
}

/* Error message */
.error-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--error-color);
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
}
