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

/* Variables and Design System */
:root {
  --font-sans: 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  
  /* Light Theme Variables */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-secondary: #ec4899;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(226, 232, 240, 0.8);
}

.dark {
  /* Dark Theme Variables */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-muted: #6b7280;
  --border-color: #374151;
  --accent-primary: #818cf8;
  --accent-primary-hover: #6366f1;
  --accent-secondary: #f472b6;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5), 0 2px 4px -2px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.5), 0 8px 10px -6px rgb(0 0 0 / 0.5);
  
  --glass-bg: rgba(17, 24, 39, 0.7);
  --glass-border: rgba(55, 65, 81, 0.8);
}

/* Global Reset & Base Styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.2s ease;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Glassmorphism Styles */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}

/* Zero Cumulative Layout Shift (CLS) Ad Slot Styles */
.ad-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background-color: var(--bg-tertiary);
  border: 2px dashed var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  position: relative;
  text-align: center;
}

/* Standard Ad Sizes to prevent Layout Shifts */
.ad-slot-header {
  width: 100%;
  max-width: 970px;
  height: 90px;
  min-height: 90px;
  margin: 1.5rem auto;
}

@media (max-width: 768px) {
  .ad-slot-header {
    max-width: 320px;
    height: 50px;
    min-height: 50px;
  }
}

.ad-slot-sidebar {
  width: 300px;
  height: 600px;
  min-height: 600px;
  position: sticky;
  top: 6rem;
}

.ad-slot-inline {
  width: 100%;
  height: 250px;
  min-height: 250px;
  margin: 2rem 0;
}

.ad-placeholder-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  pointer-events: none;
}

.ad-placeholder-size {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-left: 4px solid var(--accent-primary);
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  animation: slideIn 0.3s forwards, fadeOut 0.3s 2.7s forwards;
  max-width: 350px;
}

.toast-success {
  border-left-color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

@keyframes slideIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Accordion Animations */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}

.accordion-active .accordion-content {
  max-height: 1000px;
  transition: max-height 0.3s cubic-bezier(1, 0, 1, 0);
}

.accordion-icon {
  transition: transform 0.3s ease;
}

.accordion-active .accordion-icon {
  transform: rotate(180deg);
}

/* Image Tool Drag and Drop Effects */
.drag-over {
  border-color: var(--accent-primary);
  background-color: rgba(99, 102, 241, 0.05);
}

/* Fancy Font Previews List Grid */
.font-item-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.font-item-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Quick Emoji Picker Buttons */
.emoji-btn {
  transition: transform 0.1s ease;
}
.emoji-btn:hover {
  transform: scale(1.2);
}

/* Custom Checkbox styles */
.custom-checkbox {
  accent-color: var(--accent-primary);
}
