/* Базовые стили */
:root {
  --primary: #4361ee;
  --primary-dark: #3a56d0;
  --text: #2b2d42;
  --text-light: #8d99ae;
  --background: #f8f9fa;
  --white: #ffffff;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 15px 0;
  position: relative;
  z-index: 1000;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  z-index: 1001;
}

.logo span {
  color: var(--primary);
}

nav a {
  margin-left: 20px;
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}
/* Desktop Navigation */
.nav-wrapper {
  display: flex;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  position: relative;
  margin-left: 25px;
}

.nav-item a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  transition: color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item a:hover {
  color: var(--primary);
}

/* Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 10px 0;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  padding: 8px 20px;
  list-style: none;
}

.dropdown-menu a {
  color: var(--text);
  white-space: nowrap;
}

.dropdown-menu a:hover {
  color: var(--primary);
}

.dropdown-toggle i {
  margin-left: 5px;
  font-size: 0.8rem;
  transition: transform 0.3s;
}

.dropdown:hover .dropdown-toggle i {
  transform: rotate(180deg);
}
.dropdown.active .dropdown-toggle i {
  transform: rotate(0deg);
}
/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
}

.burger-line {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: all 0.3s ease;
}
/* Конвертер */
.converter-section {
  background: var(--white);
  padding: 40px;
  border-radius: 12px;
  margin: 40px 0;
  box-shadow: var(--shadow);
  text-align: center;
}
.converter-section h1 {
  font-size: 2rem;
}
.drop-zone {
  border: 2px dashed var(--text-light);
  padding: 40px;
  border-radius: 8px;
  margin: 20px 0;
  transition: all 0.3s;
}

.drop-zone.active {
  border-color: var(--primary);
  background: rgba(67, 97, 238, 0.05);
}

.drop-zone i {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.btn {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s;
}

.btn:hover {
  background: var(--primary-dark);
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.option {
  text-align: left;
}

.option label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.option input,
.option select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.btn-convert {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s;
  margin-top: 20px;
}

.btn-convert:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-download {
  display: inline-block;
  background: #4caf50;
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  text-decoration: none;
  margin-top: 20px;
}

.preview {
  margin-top: 30px;
}

.preview img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* Секции */
.features {
  padding: 60px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.feature {
  background: var(--white);
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--shadow);
}

.feature i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 20px;
}

/* Footer */
footer {
  background: var(--text);
  color: var(--white);
  padding: 40px 0;
  margin-top: 60px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-links a {
  color: var(--white);
  text-decoration: none;
}

.social {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
}

.social a {
  color: var(--white);
  font-size: 1.5rem;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-email {
  color: var(--white);
  text-decoration: none;
}
.footer-email:hover {
  text-decoration: underline;
}
input#quality {
  padding: 10px 0;
}
/* Адаптив */
@media (max-width: 1024px) {
  .nav-list {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .converter-section h1 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}
  .mobile-menu-btn {
    display: block;
  }

  nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--white);
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-y: auto; /* Добавляем скролл только для меню */
    -webkit-overflow-scrolling: touch; /* Для плавного скролла на iOS */
  }
  body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  nav.active {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-list {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .nav-item {
    margin: 15px 0;
  }

  .dropdown-menu {
    position: static !important;
    transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-height: 0;
    transition: max-height 0.3s ease;
    overflow: hidden;
    box-shadow: none;
    background: rgba(67, 97, 238, 0.05);
    border-radius: 8px;
    margin-top: 5px;
  }
  
  .dropdown.active .dropdown-menu {
    max-height: 500px;
    padding: 10px 0;
  }
  
  /* Фикс для Safari */
  @supports (-webkit-touch-callout: none) {
    nav {
      -webkit-overflow-scrolling: touch;
      overflow-y: scroll;
      height: 100%;
    }
    
    .dropdown-menu {
      -webkit-transform: translateZ(0);
    }
  }

  .mobile-menu-btn.active .burger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-btn.active .burger-line:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-btn.active .burger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .converter-section {
    padding: 20px;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }
  .btn {
    margin-top: 10px;
  }
  .footer-links {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .footer-copyright {
    text-align: center;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
}
.result-preview {
  margin-top: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.result-preview h3 {
  margin-bottom: 15px;
  color: var(--primary);
}

.result-preview img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.btn-save {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-save:hover {
  background: var(--primary-dark);
}
/*  */
.not-active a {
  cursor: not-allowed;
  opacity: 0.5;
}
.not-active:hover a {
  color: var(--text-light);
}

@media (max-width: 380px) {
  .logo {
    font-size: 1.2rem;
  }
}