/* ============================================
   TOOLIFY HUB - STATIC CSS
   ============================================ */

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

:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #8b5cf6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f9fafb;
  --bg-card: #ffffff;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius: 12px;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --text: #f9fafb;
  --text-muted: #94a3b8;
  --border: #334155;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background .3s, color .3s;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: 16px 0;
}
[data-theme="dark"] .navbar { background: rgba(15,23,42,0.85); }

.nav-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

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

.nav-links a {
  font-weight: 500;
  color: var(--text-muted);
  transition: color .2s;
}
.nav-links a:hover { color: var(--primary); }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text);
  transition: all .2s;
}
.theme-toggle:hover { background: var(--border); }

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

/* ===== Hero ===== */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -25%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(99,102,241,0.15), transparent 60%);
  z-index: -1;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -50%;
  right: -25%;
  width: 60%;
  height: 200%;
  background: radial-gradient(circle, rgba(139,92,246,0.15), transparent 60%);
  z-index: -1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero h1 .gradient {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all .2s;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.5); }

.btn-outline {
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

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

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 500px;
  margin: 60px auto 0;
}

.stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
}
.stat-label { color: var(--text-muted); font-size: 0.9rem; }

/* ===== Tools Grid ===== */
.section {
  padding: 60px 0;
}

.section-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 50px;
  font-size: 1.1rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: all .3s;
  display: block;
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .3s;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}
.tool-card:hover::before { transform: scaleX(1); transform-origin: left; }

.tool-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 16px;
  color: white;
}

.tool-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  font-weight: 700;
}

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

.tool-tag {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  margin-top: 12px;
}

/* Colors for each tool */
.bg-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.bg-green { background: linear-gradient(135deg, #10b981, #059669); }
.bg-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.bg-orange { background: linear-gradient(135deg, #f97316, #ea580c); }
.bg-pink { background: linear-gradient(135deg, #ec4899, #db2777); }
.bg-cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.bg-red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.bg-yellow { background: linear-gradient(135deg, #eab308, #ca8a04); }

/* ===== Features ===== */
.features {
  background: var(--bg-card);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
}
.feature-item { text-align: center; padding: 20px; }
.feature-icon-wrap {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}
.feature-item h3 { margin-bottom: 8px; }
.feature-item p { color: var(--text-muted); }

/* ===== Tool Pages ===== */
.tool-page {
  padding: 40px 0 80px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  margin-bottom: 24px;
  transition: color .2s;
}
.back-link:hover { color: var(--primary); }

.tool-header {
  text-align: center;
  margin-bottom: 40px;
}

.tool-header .tool-icon {
  margin: 0 auto 16px;
}

.tool-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.tool-header p { color: var(--text-muted); }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 50px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-card);
  transition: all .3s;
  margin-bottom: 24px;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(99,102,241,0.05);
}
.dropzone-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.dropzone p { margin-bottom: 8px; font-weight: 500; }
.dropzone small { color: var(--text-muted); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  margin-bottom: 8px;
}

.file-info { flex: 1; min-width: 0; }
.file-info strong { display: block; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-info span { color: var(--text-muted); font-size: 0.85rem; }

.file-actions { display: flex; gap: 8px; }

.btn-icon {
  background: none;
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all .2s;
}
.btn-icon:hover { background: var(--border); }
.btn-icon.danger:hover { background: var(--danger); color: white; border-color: var(--danger); }
.btn-icon:disabled { opacity: 0.3; cursor: not-allowed; }

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], textarea, select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color .2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}

textarea { resize: vertical; min-height: 100px; }

input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

input[type="color"] {
  width: 50px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab {
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all .2s;
}
.tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.result-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
}

.result-image {
  max-width: 100%;
  max-height: 400px;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.stat-box {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.stat-box .label { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 4px; }
.stat-box .value { font-size: 1.3rem; font-weight: 700; }
.stat-box.success .value { color: var(--success); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.center { text-align: center; }
.mt-3 { margin-top: 24px; }

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  animation: slideIn .3s ease;
  border-right: 4px solid var(--primary);
}

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

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

/* Footer */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  margin-top: 60px;
}

footer .footer-links {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

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

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
  .grid-2 { grid-template-columns: 1fr; }
  .stats { gap: 15px; }
  .hero { padding: 40px 0; }
  .hero h1 { font-size: 2rem; }
  .section { padding: 40px 0; }
}
