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

    body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #0c0c0c 0%, #1a1a2e 100%);
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Стилизация скроллбара для всего сайта */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #282828;
}

::-webkit-scrollbar-thumb {
    background: #573f83;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #30497d
}

::placeholder {
    color: #474747;
}

:focus-visible {
    outline: 1px solid #0080ff00;
}

::-webkit-inner-spin-button {
    appearance: none;
}

::-webkit-resizer {
  background: linear-gradient(135deg, #181818 50%, #7b7b7b 50%); /* Диагональный градиент */
}

    .container {
      max-width: 1400px;
      margin: 0 auto;
      padding: 20px;
    }

    .header {
      text-align: center;
      margin-bottom: 40px;
      animation: fadeInDown 0.8s ease-out;
    }

    .header h1 {
      font-size: 3rem;
      font-weight: 800;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      background-clip: text;
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      margin-bottom: 10px;
      text-shadow: 0 0 30px rgba(7, 7, 7, 0.3);
    }

    .header p {
      color: #a0a0a0;
      font-size: 1.1rem;
      font-weight: 300;
    }

    .main-content {
      display: grid;
      grid-template-columns: 390px 1fr;
      gap: 30px;
      margin-bottom: 50px;
      animation: fadeInUp 0.8s ease-out 0.2s both;
      z-index: 9999;
      position: relative;
    }

    .control-panel {
      background: rgba(30, 30, 30, 0.8);
      border-radius: 20px;
      padding: 30px;
      backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
      height: fit-content;
      position: sticky;
      top: 20px;
    }

    .form-group {
      margin-bottom: 25px;
    }

    .form-group label {
      display: block;
      margin-bottom: 8px;
      font-weight: 600;
      color: #f0f0f0;
      font-size: 0.9rem;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    textarea, input {
      width: 100%;
      padding: 15px;
      border: 2px solid rgba(255, 255, 255, 0.1);
      border-radius: 12px;
      background: rgba(20, 20, 20, 0.6);
      color: #e0e0e0;
      font-size: 16px;
      transition: all 0.3s ease;
      backdrop-filter: blur(10px);
    }
    
    /* Стили для функционала дополнения промта и референса */
    .prompt-controls {
      position: relative;
      margin-top: 10px;
      display: flex;
      gap: 10px;
      justify-content: center;
    }
    
    .enhance-prompt-btn, .reference-btn, .improve-prompt-btn {
      background: rgba(40, 40, 40, 0.8);
      border: 1px solid rgb(70 70 70 / 30%);
      border-radius: 8px;
      padding: 8px 15px;
      color: #fff;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .enhance-prompt-btn:hover, .reference-btn:hover, .improve-prompt-btn:hover {
      background: rgba(50, 50, 50, 0.8);
      border-color: rgba(0, 0, 0, 0.5);
    }
    
    .enhance-count {
      background: rgb(18 104 145);
      border-radius: 50%;
      width: 20px;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
    }
    
    .enhance-menu {
      position: absolute;
      top: 100%;
      left: 0;
      width: 100%;
      background: rgba(25, 25, 25, 0.95);
      border-radius: 12px;
      border: 1px solid rgba(255, 255, 255, 0.1);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
      z-index: 1000;
      padding: 15px;
      margin-top: 10px;
      display: none;
      backdrop-filter: blur(10px);
    }
    
    .enhance-menu.active {
      display: block;
      animation: fadeInDown 0.3s ease-out;
    }
    
    .enhance-menu-content {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 15px;
      max-height: 300px;
      overflow-y: auto;
      margin-bottom: 15px;
      padding-right: 5px;
    }
    
    .enhance-menu-content::-webkit-scrollbar {
      width: 6px;
    }
    
    .enhance-menu-content::-webkit-scrollbar-track {
      background: rgba(0, 0, 0, 0.2);
      border-radius: 3px;
    }
    
    .enhance-menu-content::-webkit-scrollbar-thumb {
      background: rgba(29, 29, 29, 0.5);
      border-radius: 3px;
    }
    
    .enhance-option {
      background: rgba(40, 40, 40, 0.8);
      border-radius: 8px;
      padding: 10px;
      cursor: pointer;
      transition: all 0.3s ease;
      border: 1px solid transparent;
    }
    
    .enhance-option:hover {
      background: rgba(50, 50, 50, 0.8);
      transform: translateY(-2px);
    }
    
    .enhance-option.selected {
      border-color: rgba(102, 126, 234, 0.8);
      background: rgba(102, 126, 234, 0.2);
    }
    
    .enhance-option-preview {
      width: 100%;
      height: 80px;
      border-radius: 6px;
      overflow: hidden;
      margin-bottom: 8px;
    }
    
    .enhance-option-preview img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    
    .enhance-option-text {
      font-size: 13px;
      text-align: center;
      color: #e0e0e0;
    }
    
    .reset-enhance-btn {
      width: 100%;
      padding: 10px;
      background: rgba(239, 68, 68, 0.2);
      border: 1px solid rgba(239, 68, 68, 0.3);
      border-radius: 8px;
      color: #e0e0e0;
      cursor: pointer;
      transition: all 0.3s ease;
      font-size: 14px;
    }
    
    .reset-enhance-btn:hover {
      background: rgba(239, 68, 68, 0.3);
    }

    textarea {
      min-height: 120px;
      resize: vertical;
      font-family: inherit;
      line-height: 1.5;
    }

    textarea:focus, input:focus {
      outline: none;
      border-color: #667eea;
      box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
      background: rgba(20, 20, 20, 0.8);
    }

    .generate-btn {
      width: 100%;
      padding: 18px;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border: none;
      border-radius: 12px;
      color: white;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      text-transform: uppercase;
      letter-spacing: 1px;
      position: relative;
      overflow: hidden;
    }

    .generate-btn:hover {
      transform: translateY(-2px);
      box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    }

    .generate-btn:active {
      transform: translateY(0);
    }

    .generate-btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }

    .result-area {
      background: rgba(30, 30, 30, 0.8);
      border-radius: 20px;
      padding: 30px;
      backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
      min-height: 500px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      position: relative;
    }

    .result-area.loading {
      background: linear-gradient(45deg, rgba(30, 30, 30, 0.8), rgba(40, 40, 60, 0.8));
    }

    .loader {
      width: 50px;
      height: 50px;
      border: 3px solid rgba(0, 0, 0, 0.3);
      border-top: 3px solid #667eea;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      margin-bottom: 20px;
    }

    .image-preview {
      margin: 15px 0;
      background: rgba(18, 18, 18, 0.5);
      border-radius: 12px;
      border: 1px dashed rgba(255, 255, 255, 0.2);
      padding: 15px;
      animation: fadeInDown 0.3s ease-out;
    }
    
    .image-preview-container {
      position: relative;
      width: 100%;
      border-radius: 8px;
      overflow: hidden;
      margin-bottom: 10px;
    }
    
    .image-preview img {
      width: 100%;
      max-height: 200px;
      object-fit: contain;
      display: block;
      background-color: rgba(0, 0, 0, 0.2);
    }
    
    .image-preview-overlay {
      position: absolute;
      top: 0;
      right: 0;
      padding: 8px;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
    
    .image-preview-container:hover .image-preview-overlay {
      opacity: 1;
    }
    
    .remove-image-btn {
      background: rgba(239, 68, 68, 0.8);
      border: none;
      border-radius: 50%;
      width: 30px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      cursor: pointer;
      transition: all 0.3s ease;
    }
    
    .remove-image-btn:hover {
      background: rgba(239, 68, 68, 1);
      transform: scale(1.1);
    }
    
    .image-preview-info {
      font-size: 12px;
      color: #a0a0a0;
      text-align: center;
    }
    
    /* Drag and drop styles */
    .drag-highlight {
      position: relative;
    }
    
    .drag-highlight::after {
      content: "Перетащите изображение сюда";
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.7);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
      color: white;
      z-index: 1000;
      pointer-events: none;
    }

#prompt {
    transition: none;
}

#prompt::-webkit-scrollbar-track {
    background: transparent;
}

/* Стили для кнопки референса и улучшения промта */
.reference-btn:hover, .improve-prompt-btn:hover {
    background: rgba(50, 50, 50, 0.8);
    border-color: rgba(0, 0, 0, 0.3);
}

.improve-prompt-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    padding: 8px;
}

.improve-prompt-btn svg {
    fill: currentColor;
}

.improve-prompt-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Стили для кнопки дайса */
.seed-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.seed-controls input {
    flex: 1;
}

.dice-btn {
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgb(70 70 70 / 30%);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-btn:hover {
    background: rgba(50, 50, 50, 0.8);
    border-color: rgba(20, 20, 20, 0.5);
}

    .result-image {
      max-width: 100%;
      max-height: 70vh;
      border-radius: 15px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
      transition: all 0.3s ease;
      animation: imageAppear 0.6s ease-out;
    }

    .result-image:hover {
      transform: scale(1.02);
      box-shadow: 0 25px 80px rgba(102, 126, 234, 0.2);
    }

    .result-info {
      margin-top: 20px;
      text-align: center;
      font-size: 14px;
      color: #a0a0a0;
    }

    .result-actions {
      position: absolute;
      top: 20px;
      right: 20px;
      display: flex;
      gap: 10px;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .result-area:hover .result-actions {
      opacity: 1;
    }

    .action-btn {
      width: 44px;
      height: 44px;
      border: none;
      border-radius: 50%;
      background: rgba(0, 0, 0, 0.7);
      color: white;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.3s ease;
      backdrop-filter: blur(10px);
    }

    .action-btn:hover {
      background: rgba(102, 126, 234, 0.8);
      transform: scale(1.1);
    }

    .history-section {
      animation: fadeInUp 0.8s ease-out 0.4s both;
    }

    .history-title {
      font-size: 2rem;
      font-weight: 700;
      margin-bottom: 30px;
      text-align: center;
      color: #f0f0f0;
    }

    .history-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
      gap: 20px;
      margin-bottom: 30px;
    }

    .history-item {
      background: rgba(30, 30, 30, 0.8);
      border-radius: 15px;
      padding: 15px;
      backdrop-filter: blur(20px);
      border: 1px solid rgba(255, 255, 255, 0.1);
      transition: all 0.3s ease;
      cursor: pointer;
      position: relative;
      overflow: hidden;
    }

    .history-item:hover {
      transform: translateY(-5px);
      box-shadow: 0 15px 40px rgba(102, 126, 234, 0.2);
      border-color: rgba(0, 0, 0, 0.3);
    }

    .history-item img {
      width: 100%;
      aspect-ratio: 1;
      object-fit: cover;
      border-radius: 10px;
      margin-bottom: 10px;
    }

    .history-item-info {
      font-size: 12px;
      color: #a0a0a0;
      line-height: 1.4;
    }

    .history-item-prompt {
      font-weight: 600;
      color: #e0e0e0;
      margin-bottom: 5px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .delete-btn {
      position: absolute;
      top: 10px;
      right: 10px;
      width: 24px;
      height: 24px;
      border: none;
      border-radius: 50%;
      background: rgba(239, 68, 68, 0.8);
      color: white;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      transition: all 0.3s ease;
      font-size: 14px;
      font-weight: bold;
    }

    .history-item:hover .delete-btn {
      opacity: 1;
    }

    .delete-btn:hover {
      background: rgba(239, 68, 68, 1);
      transform: scale(1.1);
    }

    .pagination {
      display: flex;
      justify-content: center;
      gap: 10px;
      margin-top: 30px;
    }

    .pagination button {
      padding: 10px 15px;
      border: none;
      border-radius: 8px;
      background: rgba(50, 50, 50, 0.8);
      color: #e0e0e0;
      cursor: pointer;
      transition: all 0.3s ease;
      font-weight: 500;
    }

    .pagination button:hover {
      background: rgba(102, 126, 234, 0.6);
    }

    .pagination button.active {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
    }

    .empty-state {
      text-align: center;
      color: #666;
      font-size: 1.1rem;
      margin: 50px 0;
    }

    .empty-state .icon {
      font-size: 4rem;
      margin-bottom: 20px;
      opacity: 0.3;
    }

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

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

    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(30px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes imageAppear {
      from {
        opacity: 0;
        transform: scale(0.9);
      }
      to {
        opacity: 1;
        transform: scale(1);
      }
    }

    @media (max-width: 1024px) {
      .main-content {
        display: flex;
        flex-direction: column-reverse;
      }
      
      .control-panel {
        position: static;
      }
      
      .header h1 {
        font-size: 2.5rem;
      }
    }

    @media (max-width: 768px) {
      .container {
        padding: 15px;
      }
      
      .header h1 {
        font-size: 2rem;
      }
      
      .control-panel, .result-area {
        padding: 20px;
      }
      
      .history-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
      }
    }
