/* ==========================================================================
   TOOLVERSE GLOBAL DESIGN SYSTEM (Vanilla CSS)
   ========================================================================== */

@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');

:root {
  /* Color Palette (Sleek Slate & Vibrant Cyan/Indigo) */
  --bg-main: #0b0f19;
  --bg-card: #151c2c;
  --bg-card-hover: #1e2638;
  --bg-nav: rgba(11, 15, 25, 0.75);
  
  --primary: #06b6d4;
  --primary-glow: rgba(6, 182, 212, 0.15);
  --secondary: #6366f1;
  --secondary-glow: rgba(99, 102, 241, 0.15);
  
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
  --accent-gradient-hover: linear-gradient(135deg, #22d3ee 0%, #818cf8 100%);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-inverse: #0b0f19;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.15);
  --error: #ef4444;
  --error-glow: rgba(239, 68, 68, 0.15);
  
  /* Layout & Spacing */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.2);
  
  --font-display: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --max-width: 1200px;
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: dark;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

/* Glassmorphism scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.section-padding {
  padding: 80px 0;
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  background-color: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: var(--transition-fast);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo i {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-weight: 500;
  font-size: 15px;
  color: var(--text-muted);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Search Bar in Header */
.search-container {
  position: relative;
  width: 240px;
}

.search-input {
  width: 100%;
  padding: 8px 16px 8px 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition-fast);
}

.search-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1100;
}

.search-dropdown.active {
  display: flex;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover {
  background: var(--bg-card-hover);
}

.search-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--primary-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-item-info {
  display: flex;
  flex-direction: column;
}

.search-item-name {
  font-size: 14px;
  font-weight: 600;
}

.search-item-cat {
  font-size: 11px;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: #22d3ee;
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

.btn-gradient {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
}

.btn-gradient:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Home / Category Directory Grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-normal);
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: var(--transition-fast);
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
}

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

.tool-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.tool-card-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-card-title {
  font-size: 18px;
  font-weight: 600;
}

.tool-card-desc {
  font-size: 14px;
  color: var(--text-muted);
  min-height: 42px;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-new {
  background: var(--success-glow);
  color: var(--success);
}

.badge-popular {
  background: var(--warning-glow);
  color: var(--warning);
}

/* Category grid container */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 32px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.category-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--secondary-glow);
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.category-title {
  font-size: 22px;
}

.category-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--text-muted);
}

.category-list-item a:hover {
  color: var(--primary);
  padding-left: 4px;
}

.category-list-item i {
  font-size: 12px;
  color: var(--primary);
}

/* Form Styles */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.input-control {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: var(--transition-fast);
}

.input-control:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
}

select.input-control {
  background-color: var(--bg-card) !important;
  color: var(--text-main) !important;
  color-scheme: dark !important;
}

select.input-control option {
  background-color: #151c2c !important;
  color: #f8fafc !important;
}

textarea.input-control {
  min-height: 120px;
  resize: vertical;
}

/* Dropzone (Common Upload Box) */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(6, 182, 212, 0.03);
}

.dropzone-icon {
  font-size: 40px;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.dropzone:hover .dropzone-icon {
  color: var(--primary);
  transform: translateY(-4px);
}

.dropzone-title {
  font-size: 18px;
  font-weight: 600;
}

.dropzone-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* Preview grid & list */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-item-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: var(--transition-fast);
}

.preview-item-remove:hover {
  background: var(--error);
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  font-weight: 500;
  font-size: 14px;
  min-width: 280px;
  max-width: 420px;
  animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transition: var(--transition-normal);
}

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

.toast i {
  font-size: 18px;
}
.toast-success i { color: var(--success); }
.toast-warning i { color: var(--warning); }
.toast-error i { color: var(--error); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Progress bar */
.progress-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
  position: relative;
  margin-top: 16px;
}

.progress-bar {
  background: var(--accent-gradient);
  height: 100%;
  width: 0%;
  transition: width 0.1s linear;
}

/* Footer styling */
.footer {
  background-color: #080c14;
  border-top: 1px solid var(--border-color);
  padding: 64px 0 32px 0;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 320px;
}

.footer-column-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-main);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-link {
  font-size: 14px;
  color: var(--text-muted);
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 32px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 600px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 1900;
  transform: translateY(150%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner.active {
  transform: translateY(0);
}

.cookie-banner-title {
  font-size: 16px;
  font-weight: 600;
}

.cookie-banner-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.cookie-banner-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  color: var(--border-hover);
}

/* Modal default style */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-main);
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .section-padding {
    padding: 60px 0;
  }
  
  .navbar .search-container {
    display: none; /* hidden on small screen nav headers */
  }
  
  .nav-links {
    display: none; /* simple burger menu / overlay in production */
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}
