/* ========================================
   ALL TOOLS PAGE - BEAUTIFUL CARDS & ADVANCED FEATURES
======================================== */

/* Header Section */
.all-tools-header {
  padding: 100px 0 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .all-tools-header {
  background: linear-gradient(135deg, #4a5fb8 0%, #5a3a7a 100%);
}

.all-tools-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.all-tools-header h1 {
  color: white;
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.all-tools-header h1 i {
  animation: toolRotate 3s ease-in-out infinite;
}

@keyframes toolRotate {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(15deg); }
}

.all-tools-header p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: 40px;
}

/* Search Box */
.search-box {
  max-width: 700px;
  margin: 0 auto 30px;
  position: relative;
}

.search-box i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #667eea;
  font-size: 1.2rem;
}

.search-box input {
  width: 100%;
  padding: 18px 50px 18px 55px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

[data-theme="dark"] .search-box input {
  background: rgba(30, 35, 50, 0.9);
  color: white;
}

.search-box input:focus {
  outline: none;
  box-shadow: 0 15px 50px rgba(102, 126, 234, 0.4);
  transform: translateY(-2px);
}

.search-shortcut {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(102, 126, 234, 0.2);
  color: #667eea;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: monospace;
}

/* Stats */
.tools-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 30px;
}

.tools-stats .stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: white;
}

.tools-stats .stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.tools-stats .stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Categories & Controls */
.categories {
  margin-top: -30px;
  padding: 0 20px 40px;
  position: relative;
  z-index: 10;
}

.controls-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.category-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: white;
  border: 2px solid #e0e7ff;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  color: #334155;
}

[data-theme="dark"] .category-btn {
  background: #1e2332;
  border-color: #2d3748;
  color: #e2e8f0;
}

.category-btn:hover {
  background: #f0f4ff;
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

[data-theme="dark"] .category-btn:hover {
  background: #2d3748;
}

.category-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.category-btn .count {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.85rem;
}

.category-btn.active .count {
  background: rgba(255, 255, 255, 0.2);
}

/* View Controls */
.view-controls {
  display: flex;
  gap: 15px;
  align-items: center;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  padding: 10px 15px;
  border-radius: 12px;
  border: 2px solid #e0e7ff;
}

[data-theme="dark"] .sort-control {
  background: #1e2332;
  border-color: #2d3748;
}

.sort-control i {
  color: #667eea;
  font-size: 1rem;
}

.sort-control select {
  border: none;
  background: transparent;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  font-size: 0.95rem;
}

[data-theme="dark"] .sort-control select {
  color: #e2e8f0;
}

.sort-control select:focus {
  outline: none;
}

.view-toggle {
  display: flex;
  gap: 8px;
  background: white;
  padding: 5px;
  border-radius: 12px;
  border: 2px solid #e0e7ff;
}

[data-theme="dark"] .view-toggle {
  background: #1e2332;
  border-color: #2d3748;
}

.view-btn {
  padding: 10px 15px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #64748b;
  transition: all 0.3s ease;
}

.view-btn:hover {
  color: #667eea;
  background: #f0f4ff;
}

[data-theme="dark"] .view-btn:hover {
  background: #2d3748;
}

.view-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* Tool Cards - Grid View */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
  padding: 20px;
}

.tool-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  text-decoration: none;
  color: inherit;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid #e0e7ff;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .tool-card {
  background: #1e2332;
  border-color: #2d3748;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

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

/* Category-Specific Background Overlays */
.tool-card[data-category="File Converters"]::before {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.08) 0%, rgba(238, 90, 111, 0.08) 100%);
}

.tool-card[data-category="Text Tools"]::before {
  background: linear-gradient(135deg, rgba(162, 155, 254, 0.08) 0%, rgba(108, 92, 231, 0.08) 100%);
}

.tool-card[data-category="Social Media"]::before {
  background: linear-gradient(135deg, rgba(253, 121, 168, 0.08) 0%, rgba(232, 67, 147, 0.08) 100%);
}

.tool-card[data-category="Developer Tools"]::before {
  background: linear-gradient(135deg, rgba(81, 207, 102, 0.08) 0%, rgba(55, 178, 77, 0.08) 100%);
}

.tool-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 60px rgba(102, 126, 234, 0.25);
  border-color: #667eea;
}

[data-theme="dark"] .tool-card:hover {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Enhanced hover shadows by category */
.tool-card[data-category="File Converters"]:hover {
  box-shadow: 0 20px 60px rgba(255, 107, 107, 0.25);
}

.tool-card[data-category="Text Tools"]:hover {
  box-shadow: 0 20px 60px rgba(162, 155, 254, 0.25);
}

.tool-card[data-category="Social Media"]:hover {
  box-shadow: 0 20px 60px rgba(253, 121, 168, 0.25);
}

.tool-card[data-category="Developer Tools"]:hover {
  box-shadow: 0 20px 60px rgba(81, 207, 102, 0.25);
}

.tool-icon {
  width: 70px;
  height: 70px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transition: all 0.4s ease;
  position: relative;
  z-index: 1;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.tool-card:hover .tool-icon {
  transform: scale(1.15) rotate(8deg);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

/* Category-Specific Colors */
/* File Converters - Red/Orange Theme */
.tool-card[data-category="File Converters"] .tool-icon {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.tool-card[data-category="File Converters"]:hover .tool-icon {
  box-shadow: 0 12px 35px rgba(255, 107, 107, 0.5);
}

.tool-card[data-category="File Converters"] .tool-category {
  color: #ff6b6b;
}

.tool-card[data-category="File Converters"]:hover {
  border-color: #ff6b6b;
}

/* Text Tools - Purple Theme */
.tool-card[data-category="Text Tools"] .tool-icon {
  background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
  box-shadow: 0 8px 25px rgba(162, 155, 254, 0.3);
}

.tool-card[data-category="Text Tools"]:hover .tool-icon {
  box-shadow: 0 12px 35px rgba(162, 155, 254, 0.5);
}

.tool-card[data-category="Text Tools"] .tool-category {
  color: #a29bfe;
}

.tool-card[data-category="Text Tools"]:hover {
  border-color: #a29bfe;
}

/* Social Media - Pink/Magenta Theme */
.tool-card[data-category="Social Media"] .tool-icon {
  background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
  box-shadow: 0 8px 25px rgba(253, 121, 168, 0.3);
}

.tool-card[data-category="Social Media"]:hover .tool-icon {
  box-shadow: 0 12px 35px rgba(253, 121, 168, 0.5);
}

.tool-card[data-category="Social Media"] .tool-category {
  color: #fd79a8;
}

.tool-card[data-category="Social Media"]:hover {
  border-color: #fd79a8;
}

/* Developer Tools - Green/Teal Theme */
.tool-card[data-category="Developer Tools"] .tool-icon {
  background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
  box-shadow: 0 8px 25px rgba(81, 207, 102, 0.3);
}

.tool-card[data-category="Developer Tools"]:hover .tool-icon {
  box-shadow: 0 12px 35px rgba(81, 207, 102, 0.5);
}

.tool-card[data-category="Developer Tools"] .tool-category {
  color: #51cf66;
}

.tool-card[data-category="Developer Tools"]:hover {
  border-color: #51cf66;
}

.tool-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
  z-index: 1;
}

.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.tool-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.badge-featured {
  background: linear-gradient(135deg, #ffd93d 0%, #f9ca24 100%);
  color: #333;
  box-shadow: 0 4px 15px rgba(255, 217, 61, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

.badge-popular {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  animation: pulse 2s ease-in-out infinite;
  animation-delay: 0.5s;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(255, 217, 61, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 217, 61, 0.6);
  }
}

.badge-popular {
  animation-name: pulsePop;
}

@keyframes pulsePop {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
  }
}

.tool-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

.tool-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #e0e7ff;
}

[data-theme="dark"] .tool-footer {
  border-color: #2d3748;
}

.tool-category {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #667eea;
  font-size: 0.85rem;
  font-weight: 600;
}

.tool-action {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #667eea;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 15px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.tool-action i {
  transition: transform 0.3s ease;
}

.tool-card:hover .tool-action {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
  transform: translateX(5px);
}

.tool-card:hover .tool-action i {
  transform: translateX(5px);
}

/* Category-specific action button colors */
.tool-card[data-category="File Converters"] .tool-action {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}

.tool-card[data-category="File Converters"]:hover .tool-action {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.tool-card[data-category="Text Tools"] .tool-action {
  color: #a29bfe;
  background: rgba(162, 155, 254, 0.1);
}

.tool-card[data-category="Text Tools"]:hover .tool-action {
  background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(162, 155, 254, 0.4);
}

.tool-card[data-category="Social Media"] .tool-action {
  color: #fd79a8;
  background: rgba(253, 121, 168, 0.1);
}

.tool-card[data-category="Social Media"]:hover .tool-action {
  background: linear-gradient(135deg, #fd79a8 0%, #e84393 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(253, 121, 168, 0.4);
}

.tool-card[data-category="Developer Tools"] .tool-action {
  color: #51cf66;
  background: rgba(81, 207, 102, 0.1);
}

.tool-card[data-category="Developer Tools"]:hover .tool-action {
  background: linear-gradient(135deg, #51cf66 0%, #37b24d 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(81, 207, 102, 0.4);
}

/* Tool Cards - List View */
.tool-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
}

.tool-list .tool-card {
  flex-direction: row;
  align-items: center;
  gap: 25px;
  padding: 25px;
}

.tool-list .tool-icon {
  width: 60px;
  height: 60px;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.tool-list .tool-content {
  flex-direction: row;
  align-items: center;
  gap: 30px;
}

.tool-list .tool-header {
  flex: 1;
  min-width: 250px;
}

.tool-list .tool-description {
  flex: 2;
  min-width: 300px;
}

.tool-list .tool-footer {
  border: none;
  padding: 0;
  margin: 0;
  gap: 30px;
}

/* No Results */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
}

.no-results i {
  font-size: 4rem;
  color: #667eea;
  opacity: 0.5;
  margin-bottom: 20px;
}

.no-results h3 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

/* Error Message */
.error-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: #ef4444;
}

.error-message i {
  font-size: 4rem;
  margin-bottom: 20px;
}

.error-message h3 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .tool-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }

  .tool-list .tool-content {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .all-tools-header {
    padding: 80px 0 50px;
  }

  .all-tools-header h1 {
    font-size: 2.2rem;
  }

  .all-tools-header p {
    font-size: 1rem;
  }

  .tools-stats {
    gap: 25px;
  }

  .tools-stats .stat-number {
    font-size: 2rem;
  }

  .controls-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .category-tabs {
    justify-content: center;
  }

  .view-controls {
    justify-content: space-between;
  }

  .tool-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .tool-list .tool-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .tool-list .tool-content {
    flex-direction: column;
    align-items: stretch;
  }

  .tool-list .tool-description {
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .all-tools-header h1 {
    font-size: 1.8rem;
    gap: 10px;
  }

  .search-box input {
    padding: 15px 50px 15px 50px;
    font-size: 0.9rem;
  }

  .search-shortcut {
    display: none;
  }

  .tools-stats {
    gap: 20px;
  }

  .tools-stats .stat-number {
    font-size: 1.8rem;
  }

  .tools-stats .stat-label {
    font-size: 0.75rem;
  }

  .category-btn {
    padding: 10px 15px;
    font-size: 0.85rem;
  }

  .tool-card {
    padding: 20px;
  }

  .tool-icon {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
  }

  .tool-name {
    font-size: 1.2rem;
  }

  .tool-description {
    font-size: 0.9rem;
  }
}

/* Special Effects for Featured & Popular Tools */
.tool-card:has(.badge-featured),
.tool-card:has(.badge-popular) {
  position: relative;
}

.tool-card:has(.badge-featured)::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #ffd93d, #f9ca24, #ffd93d);
  border-radius: 20px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

.tool-card:has(.badge-featured):hover::after {
  opacity: 0.5;
}

.tool-card:has(.badge-popular)::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #ff6b6b, #ee5a6f, #ff6b6b);
  border-radius: 20px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

.tool-card:has(.badge-popular):hover::after {
  opacity: 0.5;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Enhanced Border Glow on Hover */
.tool-card {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tool-card[data-category="File Converters"] {
  box-shadow: 0 2px 10px rgba(255, 107, 107, 0.08);
}

.tool-card[data-category="Text Tools"] {
  box-shadow: 0 2px 10px rgba(162, 155, 254, 0.08);
}

.tool-card[data-category="Social Media"] {
  box-shadow: 0 2px 10px rgba(253, 121, 168, 0.08);
}

.tool-card[data-category="Developer Tools"] {
  box-shadow: 0 2px 10px rgba(81, 207, 102, 0.08);
}

/* Icon Sparkle Effect */
.tool-icon::after {
  content: '✨';
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 1.2rem;
  opacity: 0;
  transform: scale(0);
  transition: all 0.4s ease;
}

.tool-card:hover .tool-icon::after {
  opacity: 1;
  transform: scale(1) rotate(20deg);
}

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

.tool-card {
  animation: fadeIn 0.5s ease-out backwards;
}

.tool-card:nth-child(1) { animation-delay: 0.05s; }
.tool-card:nth-child(2) { animation-delay: 0.1s; }
.tool-card:nth-child(3) { animation-delay: 0.15s; }
.tool-card:nth-child(4) { animation-delay: 0.2s; }
.tool-card:nth-child(5) { animation-delay: 0.25s; }
.tool-card:nth-child(6) { animation-delay: 0.3s; }
.tool-card:nth-child(7) { animation-delay: 0.35s; }
.tool-card:nth-child(8) { animation-delay: 0.4s; }
.tool-card:nth-child(9) { animation-delay: 0.45s; }
.tool-card:nth-child(10) { animation-delay: 0.5s; }
