/*
Theme Name: Unreacheable
Theme URI: https://unreacheable.xyz
Author: Unreacheable
Description: Image upload and public sharing theme.
Version: 1.0.0
License: GPL v2 or later
Text Domain: unreacheable
*/

html {
  scroll-behavior: smooth;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #0a0a14;
  color: #e0e0e0;
  line-height: 1.6;
  cursor: auto;
}

a, button, .btn, .drop-zone, .gallery-item, input, select, .view-btn, .site-logo, .main-nav a {
  cursor: pointer;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.site-header {
  background: rgba(15, 15, 30, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: #6c63ff;
  text-decoration: none;
  letter-spacing: -0.5px;
  transition: text-shadow 0.3s;
}

.site-logo:hover {
  text-shadow: 0 0 30px rgba(108, 99, 255, 0.6);
}

.main-nav {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  color: #aaa;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s, text-shadow 0.2s;
}

.main-nav a:hover {
  color: #fff;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
}

.hero {
  padding: 6rem 0 4rem;
  text-align: center;
  background: linear-gradient(135deg, #0f0f2a 0%, #151530 25%, #0f0f2a 50%, #120f30 75%, #0a0a14 100%);
  background-size: 400% 400%;
  animation: heroGradient 12s ease infinite;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.06) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: heroGlow 8s ease-in-out infinite alternate;
}

.hero::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.04) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  animation: heroGlow 10s ease-in-out infinite alternate-reverse;
}

@keyframes heroGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes heroGlow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.2); }
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #6c63ff, #a78bfa, #6c63ff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleShimmer 4s ease-in-out infinite;
  margin-bottom: 1rem;
  letter-spacing: -1px;
  position: relative;
  z-index: 1;
}

@keyframes titleShimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero p {
  font-size: 1.15rem;
  color: #888;
  max-width: 540px;
  margin: 0 auto 2rem;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-btn {
  font-size: 1.05rem;
  padding: 1rem 2.5rem;
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out 0.4s both;
  display: inline-block;
  margin-top: 1rem;
}

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

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #fff;
}

.section-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  background: linear-gradient(90deg, #6c63ff, #a78bfa);
  border-radius: 2px;
  margin-top: 0.5rem;
  animation: titleBar 1s ease-out;
}

@keyframes titleBar {
  from { width: 0; opacity: 0; }
  to { width: 48px; opacity: 1; }
}

.upload-section {
  padding: 4rem 0;
}

.drop-zone {
  border: 2px dashed rgba(108, 99, 255, 0.3);
  border-radius: 16px;
  padding: 3rem;
  text-align: center;
  transition: all 0.4s;
  background: rgba(108, 99, 255, 0.03);
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: #6c63ff;
  background: rgba(108, 99, 255, 0.08);
  box-shadow: 0 0 50px rgba(108, 99, 255, 0.1);
  transform: scale(1.01);
}

.upload-icon {
  width: 56px;
  height: 56px;
  color: #6c63ff;
  margin-bottom: 1rem;
  animation: floatIcon 3s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(108, 99, 255, 0.3));
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.drop-zone-content p {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ccc;
  margin-bottom: 0.4rem;
}

.drop-hint {
  font-size: 0.85rem;
  color: #666;
}

.upload-status {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.95rem;
}

.upload-status.error {
  color: #f87171;
}

.upload-status.success {
  color: #34d399;
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(108, 99, 255, 0.2);
  border-top-color: #6c63ff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 0.5rem;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.share-box {
  margin-top: 2rem;
  padding: 2rem;
  background: rgba(108, 99, 255, 0.05);
  border: 1px solid rgba(108, 99, 255, 0.15);
  border-radius: 16px;
  text-align: center;
  animation: fadeInUp 0.5s ease-out;
}

.share-box h3 {
  color: #34d399;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.share-preview {
  margin-bottom: 1.25rem;
}

.share-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.share-link-wrap {
  display: flex;
  gap: 0.5rem;
  max-width: 480px;
  margin: 0 auto;
}

.share-link-wrap input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #1a1a2e;
  color: #e0e0e0;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.share-link-wrap input:focus {
  border-color: #6c63ff;
  box-shadow: 0 0 20px rgba(108, 99, 255, 0.1);
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #6c63ff, #7c73ff);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  background: linear-gradient(135deg, #5a52e0, #6c63ff);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(108, 99, 255, 0.3);
}

.btn::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn:hover::after {
  opacity: 1;
}

.share-note {
  color: #666;
  font-size: 0.85rem;
  margin-top: 1rem;
}

.gallery-section {
  padding: 4rem 0;
  background: #0d0d1a;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #151528;
  aspect-ratio: 1;
  transition: transform 0.4s, box-shadow 0.4s;
  animation: fadeInUp 0.6s ease-out both;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.15s; }
.gallery-item:nth-child(3) { animation-delay: 0.2s; }
.gallery-item:nth-child(4) { animation-delay: 0.25s; }
.gallery-item:nth-child(5) { animation-delay: 0.3s; }
.gallery-item:nth-child(6) { animation-delay: 0.35s; }
.gallery-item:nth-child(7) { animation-delay: 0.4s; }
.gallery-item:nth-child(8) { animation-delay: 0.45s; }

.gallery-item:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 50px rgba(108, 99, 255, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s;
}

.gallery-item {
  position: relative;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.3s;
  cursor: pointer;
  z-index: 2;
}

.gallery-item:hover .play-overlay {
  opacity: 1;
}

.play-overlay svg {
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-overlay .view-btn {
  background: rgba(108, 99, 255, 0.9);
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.3s, transform 0.3s;
}

.gallery-item-overlay .view-btn:hover {
  background: #6c63ff;
  transform: scale(1.05);
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #666;
  font-size: 1rem;
}

.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #555;
}

.footer-made {
  color: #6c63ff;
}

@media (max-width: 640px) {
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 1rem; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .footer-inner { flex-direction: column; gap: 0.5rem; text-align: center; }
}
