:root {
  /* Color Variables */
  --bg: #0f0f1a;
  --card: #18182a;
  --accent: #00d4ff;
  --accent-secondary: #ff014f;
  --text: #ffffff;
  --text-muted: #94a3b8;
  --border: #334155;
  --nav-bg: rgba(24, 24, 42, 0.9);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Main Background Gradient */
  background: linear-gradient(135deg, #0f0f1a 0%, #171731 50%, #0c0936 100%);
  transition: background 0.5s ease;
}

/* --- Top Navigation --- */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,212,255,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.logo {
  font-size: 1.8rem;
  font-weight: 800;
  text-decoration: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}
.nav-links {
  display: flex;
  list-style: none;
}
.nav-links li {
  margin-left: 30px;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: color 0.3s ease;
}
.nav-links a:hover {
  color: var(--accent);
}
.nav-button {
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}
.nav-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,212,255,0.2);
}

/* Hamburger menu for mobile */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 10px;
  background: transparent;
  border: none;
  outline: none;
}
.hamburger .bar {
  height: 3px;
  width: 25px;
  background-color: var(--text);
  margin: 4px 0;
  transition: 0.4s;
}

/* --- Hero Section (Main Header Content) --- */
.hero-section {
  text-align: center;
  padding: 60px 20px 80px;
  position: relative;
  overflow: hidden;
}
.hero-section h1 {
  font-size: 3.8rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 15px;
  letter-spacing: -2px;
  line-height: 1.2;
}
.hero-section .subtitle {
  font-size: 1.3rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 30px;
  line-height: 1.6;
}
.main-cta {
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  color: white;
  padding: 18px 35px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0,212,255,0.3);
  display: inline-flex;
  align-items: center;
  margin-top: 20px;
}
.main-cta i {
  margin-right: 10px;
}
.main-cta:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,212,255,0.4);
}

/* Main Content Area */
main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}

.container {
  width: 100%;
  max-width: 800px;
}

.card {
  background: var(--card);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.6);
  border: 1px solid rgba(0,212,255,0.15);
  backdrop-filter: blur(15px);
  transition: all 0.4s ease;
  margin-bottom: 40px;
}
/* Input Group, Buttons, and Thumbnails CSS */
.input-group {
  position: relative;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: rgba(30,30,50,0.6);
  transition: all 0.3s ease;
}

.input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0,212,255,0.2);
}

#url-input {
  flex-grow: 1;
  padding: 18px 20px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: white;
  font-size: 1.1rem;
  outline: none;
}

.clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0 15px;
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.2s ease;
  outline: none;
  display: none;
}

.clear-btn:hover {
  color: var(--text);
}

#grab-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 10px 30px rgba(0,212,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

#grab-btn i {
  margin-right: 10px;
}

#grab-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0,212,255,0.4);
}

#grab-btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 30px rgba(0,212,255,0.3);
}

.thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 30px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.thumbnails.show {
  opacity: 1;
  transform: translateY(0);
}

.thumb-card {
  background: rgba(30,30,50,0.7);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border);
  box-shadow: 0 8px 15px rgba(0,0,0,0.3);
}

.thumb-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(0,212,255,0.15);
}

.thumb-card img {
  width: 100%;
  height: auto;
  min-height: 150px;
  display: block;
  background: #000;
  object-fit: cover;
}

.thumb-info {
  padding: 16px;
  text-align: center;
}

.quality {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
  font-size: 1.1rem;
}

.resolution {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.download-btn {
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  outline: none;
}

.download-btn i {
  margin-right: 8px;
}

.download-btn:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

/* Error and Loading Styles remain the same */
.error {
  background: rgba(255,66,100,0.15);
  color: #ff4264;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  margin-top: 20px;
  border: 1px solid rgba(255,66,100,0.3);
  font-weight: 500;
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.loading {
  text-align: center;
  padding: 40px 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.spinner {
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  width: 25px;
  height: 25px;
  animation: spin 1s linear infinite;
  margin-right: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- Article Content Styling (Now Blended with Main BG) --- */
.content-area {
    padding: 40px 0; /* Padding inside the container, without a box */
    margin-top: 20px;
}
.content-area h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 0;
  margin-bottom: 20px;
  border-left: 4px solid var(--accent);
  padding-left: 15px;
}
.content-area h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 30px;
  margin-bottom: 15px;
}
.content-area p, .content-area li {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 15px;
  text-align: justify;
}
.content-area a {
  color: var(--accent);
  text-decoration: none;
}
.content-area ul, .content-area ol {
  margin-left: 20px;
  padding-left: 10px;
  margin-bottom: 20px;
}
.content-area li {
  margin-bottom: 8px;
}

footer {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  font-size: 0.9rem;
  border-top: 1px solid rgba(51, 65, 85, 0.2);
  margin-top: 50px;
}

/* --- Media Queries for Responsiveness --- */
@media (max-width: 768px) {
  .top-nav {
    padding: 15px 20px;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 70px;
    left: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid rgba(0,212,255,0.1);
    padding: 20px 0;
  }
  .nav-links.active {
    display: flex;
  }
  .nav-links li {
    margin: 10px 0;
    text-align: center;
  }
  .hamburger {
    display: flex;
  }
  .nav-button {
    display: none;
  }

  .hero-section h1 { font-size: 2.8rem; }
  .hero-section .subtitle { font-size: 1.1rem; }
  .main-cta { padding: 15px 30px; font-size: 1.1rem; }

  .card { padding: 24px; }
  .content-area { padding: 20px 0; }
  .content-area h2 { font-size: 1.8rem; }
  .content-area h3 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .hero-section h1 { font-size: 2.2rem; letter-spacing: -1px; }
  .hero-section .subtitle { font-size: 1rem; }
  .main-cta { padding: 12px 25px; font-size: 1rem; }
  .logo { font-size: 1.5rem; }
}