@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&family=Roboto+Mono:wght@300;400;500;700&display=swap');

* { margin:0; padding:0; box-sizing:border-box; }

body {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1f1f1f 100%);
  color: #e0e0e0;
  font-family: 'Roboto Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255,255,255,0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
header {
  text-align: center;
  margin-bottom: 3rem;
}
h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: 8px;
  text-shadow: 
    0 0 10px rgba(255,255,255,0.3),
    0 0 20px rgba(255,255,255,0.2),
    0 0 40px rgba(255,255,255,0.1);
  animation: glow 2s ease-in-out infinite alternate;
  color: #f5f5f5;
}

@keyframes glow {
  from { text-shadow: 0 0 10px rgba(255,255,255,0.3), 0 0 20px rgba(255,255,255,0.2), 0 0 40px rgba(255,255,255,0.1); }
  to { text-shadow: 0 0 20px rgba(255,255,255,0.4), 0 0 30px rgba(255,255,255,0.3), 0 0 60px rgba(255,255,255,0.2); }
}

header p {
  color: #b0b0b0;
  font-size: 1.2rem;
  margin-top: 0.5rem;
  font-weight: 300;
  letter-spacing: 2px;
}

/* Поиск */
.search-container {
  position: relative;
  max-width: 500px;
  margin: 0 auto 2rem;
}

#search {
  width: 100%;
  padding: 1rem 3rem 1rem 1.5rem;
  background: rgba(45,45,45,0.8);
  border: 2px solid #666;
  border-radius: 25px;
  color: #e0e0e0;
  font-family: 'Roboto Mono', monospace;
  font-size: 1.1rem;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

#search:focus {
  box-shadow: 0 0 25px rgba(255,255,255,0.2);
  border-color: #888;
}

#search::placeholder {
  color: #888;
}

.search-icon {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: #888;
  pointer-events: none;
}

/* Статистика */
.stats {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: #999;
}

.stats span {
  margin: 0 1rem;
  padding: 0.5rem 1rem;
  background: rgba(255,255,255,0.05);
  border-radius: 15px;
  border: 1px solid rgba(255,255,255,0.1);
}
#pastes {
  display: grid;
  gap: 1rem;
}
.paste-card {
  background: linear-gradient(135deg, rgba(45,45,45,0.9) 0%, rgba(60,60,60,0.9) 100%);
  border: 1px solid #666;
  padding: 1.5rem;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 15px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  animation: slideUp 0.6s ease-out forwards;
  opacity: 0;
  transform: translateY(30px);
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.paste-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.6s;
}

.paste-card:hover::before {
  left: 100%;
}

.paste-card:hover {
  background: linear-gradient(135deg, rgba(60,60,60,0.95) 0%, rgba(75,75,75,0.95) 100%);
  box-shadow: 
    0 8px 30px rgba(0,0,0,0.4),
    0 0 50px rgba(255,255,255,0.1);
  transform: translateY(-8px) scale(1.02);
  border-color: #888;
}

.paste-card[data-pinned="true"] {
  border-color: #ffd700;
  background: linear-gradient(135deg, rgba(60,50,30,0.9) 0%, rgba(80,70,40,0.9) 100%);
  box-shadow: 
    0 4px 15px rgba(255,215,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.1);
}

.paste-card[data-pinned="true"]:hover {
  background: linear-gradient(135deg, rgba(80,70,40,0.95) 0%, rgba(100,85,50,0.95) 100%);
  border-color: #ffed4e;
  box-shadow: 
    0 8px 30px rgba(255,215,0,0.3),
    0 0 50px rgba(255,215,0,0.2);
}

.paste-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.paste-title {
  font-size: 1.4rem;
  color: #f0f0f0;
  font-weight: 500;
  flex: 1;
  min-width: 200px;
}

.paste-nick {
  background: rgba(255,255,255,0.1);
  color: #d0d0d0;
  padding: 0.3rem 0.8rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.2);
}

.paste-meta {
  display: flex;
  gap: 1rem;
  color: #aaa;
  font-size: 0.9rem;
  font-weight: 300;
}

.paste-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Нет результатов */
.no-results {
  text-align: center;
  padding: 3rem;
  color: #777;
  font-size: 1.2rem;
  font-style: italic;
}

.pin-icon {
  color: #ffd700;
  margin-right: 0.5rem;
  font-size: 1.2rem;
  text-shadow: 0 0 10px rgba(255,215,0,0.5);
  animation: pinGlow 2s ease-in-out infinite alternate;
}

@keyframes pinGlow {
  from { text-shadow: 0 0 5px rgba(255,215,0,0.5); }
  to { text-shadow: 0 0 15px rgba(255,215,0,0.8); }
}

.pinned-badge {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #000;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(255,215,0,0.3);
}

/* Модалка */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.95);
  backdrop-filter: blur(5px);
}
.modal-content {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 95%;
  max-width: 1200px;
  max-height: 95vh;
  background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 50%, #1a1a1a 100%);
  border: 1px solid #555;
  border-radius: 25px;
  overflow: hidden;
  box-shadow: 
    0 25px 80px rgba(0,0,0,0.9),
    0 0 120px rgba(255,255,255,0.05),
    inset 0 1px 0 rgba(255,255,255,0.1);
  animation: modalAppear 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.modal-content h2 {
  background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 50%, #2d2d2d 100%);
  color: #f5f5f5;
  padding: 2rem;
  font-size: 2rem;
  text-align: center;
  font-weight: 700;
  position: relative;
  border-bottom: 1px solid #444;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 1px;
}

#modal-body {
  padding: 2.5rem;
  background: 
    linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 50%, #1f1f1f 100%),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.02) 0%, transparent 50%);
  color: #e8e8e8;
  max-height: 60vh;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 1.15rem;
  line-height: 1.9;
  font-weight: 400;
  position: relative;
  border-radius: 0 0 25px 25px;
}

#modal-body::before {
  content: '';
  position: absolute;
  top: 0; left: 2rem; right: 2rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

#modal-body::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, #4CAF50, #45a049, #4CAF50);
  border-radius: 0 2px 2px 0;
}

#modal-body::-webkit-scrollbar {
  width: 12px;
}

#modal-body::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  margin: 1rem 0;
}

#modal-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4CAF50, #45a049);
  border-radius: 6px;
  border: 2px solid rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

#modal-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #45a049, #4CAF50);
  border-color: rgba(255,255,255,0.1);
}

.close {
  position: absolute;
  top: 20px; right: 30px;
  font-size: 2.5rem;
  color: #f0f0f0;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: bold;
  width: 50px; height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.2);
}

  .close:hover { 
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
  transform: scale(1.1) rotate(90deg);
  color: #ff6b6b;
}

/* Галерея изображений в модалке */
.modal-images {
  padding: 2rem;
  background: linear-gradient(135deg, #252525 0%, #2f2f2f 50%, #252525 100%);
  border-bottom: 1px solid #444;
  position: relative;
}

.modal-images::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: 
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.02) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(255,255,255,0.015) 0%, transparent 50%);
  pointer-events: none;
}

.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.image-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 8px 25px rgba(0,0,0,0.4),
    0 4px 10px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
}

.image-item:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 
    0 15px 40px rgba(0,0,0,0.6),
    0 8px 20px rgba(0,0,0,0.4),
    0 0 30px rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.image-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.image-item:hover img {
  transform: scale(1.1);
}

.image-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: 
    linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%),
    radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(2px);
}

.image-item:hover .image-overlay {
  opacity: 1;
}

.zoom-icon {
  color: #fff;
  font-size: 2.5rem;
  text-shadow: 
    0 2px 8px rgba(0,0,0,0.8),
    0 0 20px rgba(255,255,255,0.3);
  animation: zoomPulse 2s ease-in-out infinite;
}

@keyframes zoomPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Просмотрщик изображений */
.image-viewer {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.95);
  backdrop-filter: blur(10px);
}

.image-viewer-content {
  position: relative;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#viewer-image {
  max-width: 90%;
  max-height: 80%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.image-close {
  position: absolute;
  top: 20px; right: 30px;
  font-size: 3rem;
  color: #fff;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.image-close:hover {
  opacity: 0.7;
  transform: scale(1.1);
}

.image-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 2rem;
  pointer-events: none;
}

.nav-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 3rem;
  padding: 1rem 1.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  pointer-events: all;
  font-weight: bold;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: scale(1.1);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.image-controls {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
}

.download-btn {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  padding: 1rem 2rem;
  text-decoration: none;
  border-radius: 25px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(76,175,80,0.3);
  font-family: 'Roboto Mono', monospace;
}

.download-btn:hover {
  background: linear-gradient(135deg, #45a049 0%, #4CAF50 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76,175,80,0.4);
}

/* Адаптивность */
@media (max-width: 768px) {
  .container {
    padding: 1rem 0.5rem;
  }
  
  h1 {
    font-size: 2.5rem;
    letter-spacing: 4px;
  }
  
  .search-container {
    max-width: 100%;
    margin: 0 1rem 2rem;
  }
  
  #search {
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    font-size: 1rem;
  }
  
  .paste-card {
    padding: 1rem;
    margin: 0 1rem;
  }
  
  .paste-title {
    font-size: 1.2rem;
  }
  
  .paste-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .paste-nick {
    align-self: flex-end;
  }
  
  .paste-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .modal-content h2 {
    font-size: 1.4rem;
    padding: 1rem;
  }
  
  #modal-body {
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .stats {
    margin: 0 1rem 2rem;
  }
  
  .stats span {
    display: block;
    margin: 0.5rem 0;
  }

  .modal-images {
    padding: 1rem;
  }

  .image-gallery {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
  }

  .image-item img {
    height: 140px;
  }

  .modal-content h2 {
    font-size: 1.5rem;
    padding: 1.5rem;
  }

  #modal-body {
    padding: 1.5rem;
    font-size: 1rem;
    line-height: 1.7;
  }

  .close {
    top: 15px; right: 20px;
    width: 40px; height: 40px;
    font-size: 2rem;
  }

  .nav-btn {
    font-size: 2rem;
    padding: 0.5rem 1rem;
  }

  .image-close {
    font-size: 2.5rem;
    top: 15px; right: 20px;
  }

  #viewer-image {
    max-width: 95%;
    max-height: 70%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
    letter-spacing: 2px;
  }
  
  header p {
    font-size: 1rem;
  }
  
  .paste-card {
    margin: 0 0.5rem;
  }
}