:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #1a1a1a;
  --bg-hover: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --accent: #00d4ff;
  --accent-hover: #00b8e6;
  --border: #333;
  --shadow: rgba(0, 0, 0, 0.5);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Animated gradient background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 50%, rgba(0, 212, 255, 0.05) 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(0, 212, 255, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Header */
header {
  padding: 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: rgba(26, 26, 26, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #00ff88);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  animation: fadeInDown 0.8s ease;
  letter-spacing: 2px;
}

.tagline {
  color: var(--text-secondary);
  font-size: 1rem;
  animation: fadeInUp 0.8s ease;
}

nav {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
}

nav a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

nav a.active {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

/* Main content */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.hero {
  text-align: center;
  padding: 4rem 2rem;
  animation: fadeIn 1s ease;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* GIF Grid */
.gif-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
  animation: fadeInUp 1s ease;
}

.gif-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.gif-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 255, 136, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gif-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px var(--shadow);
  border-color: var(--accent);
}

.gif-card:hover::before {
  opacity: 1;
}

.gif-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
  background: var(--bg-hover);
}

.gif-info {
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.gif-title {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.gif-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.gif-date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-link {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.85rem;
}

.copy-link:hover {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

/* Single GIF page */
.gif-single {
  max-width: 900px;
  margin: 0 auto;
  animation: fadeIn 0.8s ease;
}

.gif-container {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid var(--border);
  text-align: center;
}

.gif-container img {
  max-width: 100%;
  border-radius: 12px;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px var(--shadow);
}

.gif-details {
  text-align: left;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.gif-details h2 {
  margin-bottom: 1rem;
  font-size: 2rem;
}

.gif-url {
  background: var(--bg-hover);
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.gif-url input {
  background: transparent;
  border: none;
  color: var(--accent);
  flex: 1;
  font-family: monospace;
  font-size: 0.95rem;
  outline: none;
}

.btn {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
}

/* Loading states */
.loading {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.spinner {
  border: 3px solid var(--bg-secondary);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 100px;
  height: 100px;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  box-shadow: 0 4px 12px var(--shadow);
  animation: slideInRight 0.3s ease;
  z-index: 1000;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .logo {
    font-size: 2rem;
  }
  
  .gif-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  main {
    padding: 2rem 1rem;
  }
  
  .toast {
    left: 1rem;
    right: 1rem;
  }
}