/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;600;700;800&display=swap');

/* Global Variables and Design System */
:root {
  --bg-color: #0b0b0f;
  --panel-bg: rgba(22, 22, 33, 0.7);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  /* Vibrant Brand Gradients */
  --primary-glow: linear-gradient(135deg, #8b5cf6 0%, #ec4899 50%, #f43f5e 100%);
  --secondary-glow: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --success-glow: linear-gradient(135deg, #10b981 0%, #059669 100%);
  
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.2);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Header & Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 15, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--panel-border);
  transition: var(--transition-smooth);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  background: var(--primary-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo span {
  background: var(--secondary-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  border: 1px solid var(--panel-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Main Container */
main {
  max-width: 1200px;
  margin: 2rem auto 6rem auto;
  padding: 0 2rem;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 4rem;
  animation: fadeIn 0.8s ease-out;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.hero h1 span {
  background: var(--primary-glow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* Tool Grid (Home Screen) */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.tool-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-glow);
  opacity: 0;
  z-index: 0;
  transition: var(--transition-smooth);
}

.tool-card:hover {
  transform: translateY(-5px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.tool-card:hover::before {
  opacity: 0.03;
}

.tool-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.tool-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--accent-purple);
}

.tool-card:nth-child(2) .tool-icon svg {
  fill: var(--accent-cyan);
}

.tool-card:nth-child(3) .tool-icon svg {
  fill: var(--accent-pink);
}

.tool-card h3 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.tool-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  position: relative;
  z-index: 1;
}

.tool-card .learn-more {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-purple);
  position: relative;
  z-index: 1;
  transition: var(--transition-smooth);
}

.tool-card:nth-child(2) .learn-more {
  color: var(--accent-cyan);
}

.tool-card:nth-child(3) .learn-more {
  color: var(--accent-pink);
}

.tool-card:hover .learn-more {
  gap: 0.75rem;
}

/* Page Sections (Hidden by default, shown when active) */
.page-section {
  display: none;
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-section.active {
  display: block;
}

.section-header {
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
}

.section-header .back-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.section-header .back-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

/* Tool Form Styling */
.tool-container {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 2.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
}

.input-group {
  margin-bottom: 2rem;
}

.input-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
  display: flex;
  width: 100%;
}

.input-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  padding: 1.2rem 1.5rem;
  border-radius: 14px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.05rem;
  transition: var(--transition-smooth);
}

.input-field:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.btn-primary {
  background: var(--primary-glow);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
  opacity: 0.95;
}

.btn-primary:active {
  transform: translateY(0);
}

/* Tool Outputs */
.output-section {
  margin-top: 2.5rem;
  border-top: 1px solid var(--panel-border);
  padding-top: 2.5rem;
  display: none;
}

.output-section.active {
  display: block;
}

/* Thumbnail Downloader Specifics */
.thumbnail-preview-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2.5rem;
}

.main-preview-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.main-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.download-options-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.download-option-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.download-option-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.option-details h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.option-details span {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.btn-download-sm {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.btn-download-sm:hover {
  background: var(--text-primary);
  color: var(--bg-color);
  border-color: var(--text-primary);
}

/* Embed Generator Specifics */
.embed-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

.embed-settings {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-cyan);
}

.code-output-box {
  position: relative;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 1.2rem;
  margin-top: 1.5rem;
}

.code-output-box pre {
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  color: var(--accent-cyan);
}

.btn-copy {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-copy:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.15);
}

/* Title & Description Counter Specifics */
.counters-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 2.5rem;
}

.counter-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.counter-group {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1.5rem;
}

.counter-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.counter-meta h4 {
  font-size: 1rem;
  font-weight: 600;
}

.counter-number {
  font-weight: 700;
  font-size: 0.9rem;
}

.counter-number.warn {
  color: #f59e0b;
}

.counter-number.error {
  color: #ef4444;
}

.textarea-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 1rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  resize: vertical;
  transition: var(--transition-smooth);
}

.textarea-field:focus {
  outline: none;
  border-color: var(--accent-pink);
}

.description-templates {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.template-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 1rem;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.template-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--accent-pink);
}

.template-card h5 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

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

/* Footer Section */
footer {
  border-top: 1px solid var(--panel-border);
  padding: 3rem 0;
  background: rgba(11, 11, 15, 0.9);
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

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

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

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

.disclaimer-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 700px;
  line-height: 1.4;
}

.copyright-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive Breakpoints */
@media (max-width: 968px) {
  .hero h1 {
    font-size: 2.8rem;
  }
  .thumbnail-preview-grid,
  .embed-form-grid,
  .counters-grid {
    grid-template-columns: 1fr;
  }
  .main-preview-box {
    max-width: 500px;
    margin: 0 auto;
  }
  .tool-container {
    padding: 1.5rem;
  }
}

@media (max-width: 576px) {
  .nav-container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .nav-menu {
    width: 100%;
    justify-content: center;
    gap: 0.5rem;
  }
  .nav-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }
  .hero h1 {
    font-size: 2.2rem;
  }
  .hero p {
    font-size: 1rem;
  }
  main {
    margin-top: 1rem;
  }
  .section-header h2 {
    font-size: 1.6rem;
  }
}
