/* Reset и базовые стили */
:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-gray: #f5f5f5;
    --dark-gray: #333;
    --border-radius: 5px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Заголовок */
header {
    background-color: var(--secondary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--box-shadow);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo img {
    height: 40px;
    width: auto;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    gap: 1.5rem;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

/* Основное содержимое */
main {
    flex: 1;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.breadcrumbs {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Редактор */
.editor-container {
    width: 100%;
    margin: 1.5rem 0;
}

.editor-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.editor-controls {
    background: var(--light-gray);
    padding: 0.75rem;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.editor-controls button, 
.editor-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.editor-controls button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.editor-controls select {
    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='currentColor' 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 0.5rem center;
    background-size: 1rem;
    padding-right: 2rem;
}

#photopea-iframe {
    width: 100%;
    min-height: 70vh;
    border: 1px solid #ddd;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    background: white;
}

/* Рекламные блоки */
.horizontal-ad {
    width: 100%;
    background: var(--light-gray);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    text-align: center;
}

/* Возможности */
.features {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--light-gray);
    border-radius: var(--border-radius);
}

.features h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.features ul {
    list-style-position: inside;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.5rem 1.5rem;
}

.features li {
    margin-bottom: 0.5rem;
}

/* Подвал */
footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 1.5rem 0;
    text-align: center;
    margin-top: auto;
}

.footer-info {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-info p {
    margin-bottom: 0.5rem;
}

.footer-info a {
    color: var(--primary-color);
    text-decoration: none;
}

/* Вспомогательные классы */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .logo {
        flex-direction: column;
        text-align: center;
    }
    
    .logo img {
        margin-bottom: 0.5rem;
    }
    
    .editor-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .features ul {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    main {
        padding: 1rem;
    }
    
    nav ul {
        gap: 1rem;
    }
    
    #photopea-iframe {
        min-height: 60vh;
    }
}

/* Стили для Cookie Popup (низ слева) */
.cookie-popup {
  position: fixed;
  bottom: 20px;
  left: 20px;
  max-width: 380px;
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transform: translateY(150%);
  transition: transform 0.4s ease-out;
  font-size: 14px;
  line-height: 1.5;
  border-left: 4px solid #3498db;
}

.cookie-popup.show {
  transform: translateY(0);
}

.cookie-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.cookie-content p {
  margin: 0;
  color: #333;
}

.cookie-content a {
  color: #3498db;
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 8px 16px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  font-size: 14px;
}

.cookie-btn.accept {
  background: #3498db;
  color: white;
}

.cookie-btn.reject {
  background: #f5f5f5;
  color: #333;
}

.cookie-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Стили для Bookmark Popup (верх справа) */
.bookmark-popup {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 280px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  font-family: 'Segoe UI', Roboto, sans-serif;
  transform: translateX(150%);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  border-top: 4px solid #3498db;
}

.bookmark-popup.show {
  transform: translateX(0);
}

.bookmark-popup p {
  color: #3498db;
  margin: 0 0 12px 0;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
}

.shortcut-keys {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shortcut span {
  color: #333;
  font-size: 13px;
  min-width: 50px;
}

kbd {
  background: #f5f5f5;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: #333;
  border: 1px solid #ddd;
  font-family: monospace;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.close-popup {
  position: absolute;
  top: 10px;
  right: 10px;
  color: #999;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-popup:hover {
  color: #333;
  background: #f5f5f5;
}

/* Адаптивность */
@media (max-width: 768px) {
  .cookie-popup {
    max-width: calc(100% - 40px);
    left: 20px;
    right: 20px;
    bottom: 10px;
  }
  
  .bookmark-popup {
    width: calc(100% - 40px);
    right: 20px;
    left: auto;
    top: 10px;
  }
  
  .cookie-buttons {
    flex-direction: column;
  }
  
  .cookie-btn {
    width: 100%;
  }
}