:root {
  --bg-color: #0a0a0f;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --ig-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  --ig-gradient-hover: linear-gradient(45deg, #bc1888 0%, #cc2366 25%, #dc2743 50%, #e6683c 75%, #f09433 100%);
  --success: #28a745;
  --error: #dc3545;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Animated Background Gradient */
.bg-glow {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(220, 39, 67, 0.15) 0%, rgba(10, 10, 15, 0) 50%);
  z-index: -1;
  animation: rotateGlow 20s linear infinite;
  pointer-events: none;
}

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

/* Navigation */
nav {
  padding: 1.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--ig-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary);
}

/* Main Container */
main {
  flex: 1;
  padding: 3rem 5%;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero {
  text-align: center;
  margin-bottom: 3rem;
}

h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  background: var(--ig-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Input Area */
.input-container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 0.5rem;
  display: flex;
  gap: 0.5rem;
  max-width: 800px;
  margin: 0 auto 2rem;
  backdrop-filter: blur(10px);
  position: relative;
}

input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 1rem 1.5rem;
  color: var(--text-primary);
  font-size: 1.1rem;
  outline: none;
}

input::placeholder {
  color: var(--text-secondary);
}

.btn-paste {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 1rem;
  font-size: 1.2rem;
  transition: color 0.3s;
}

.btn-paste:hover {
  color: var(--text-primary);
}

.btn-download {
  background: var(--ig-gradient);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.3s;
}

.btn-download:hover {
  transform: translateY(-2px);
  background: var(--ig-gradient-hover);
}

.btn-download:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Results Area */
#result-container {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.media-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: transform 0.3s;
}

.media-card:hover {
  transform: translateY(-5px);
}

.media-preview {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  background: #111;
  display: block;
}

.media-info {
  padding: 1.5rem;
  text-align: center;
}

.btn-save {
  display: inline-block;
  background: var(--ig-gradient);
  color: white;
  text-decoration: none;
  padding: 0.8rem 2rem;
  border-radius: 8px;
  font-weight: 600;
  width: 100%;
  text-align: center;
  transition: opacity 0.3s;
  cursor: pointer;
  border: none;
}

.btn-save:hover {
  opacity: 0.9;
}

/* Ad Spots */
.ad-spot {
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
  margin: 3rem 0;
  font-size: 0.9rem;
}

/* Loader */
.loader {
  display: none;
  width: 48px;
  height: 48px;
  border: 5px solid var(--card-border);
  border-bottom-color: #dc2743;
  border-radius: 50%;
  animation: rotation 1s linear infinite;
  margin: 2rem auto;
}

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

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1rem 2rem;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  transform: translateY(150%);
  transition: transform 0.3s;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
}

.toast.error {
  border-left: 4px solid var(--error);
}

.toast.success {
  border-left: 4px solid var(--success);
}

/* Features Section */
.features {
  margin-top: 5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  text-align: center;
  padding: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
}

.feature-card h3 {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 5%;
  border-top: 1px solid var(--card-border);
  margin-top: auto;
  color: var(--text-secondary);
}

.footer-links {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text-primary);
}

/* Mobile */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  .input-container { flex-direction: column; padding: 1rem; }
  .nav-links { display: none; /* simple mobile nav for now */ }
}
