/* ===== CAJA DE HERRAMIENTAS - MATERIAL DESIGN ===== */

/* Import Material Icons */
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

/* Section Container */
.tools-section {
  background: linear-gradient(135deg, #f8fafe 0%, #e8f4f8 100%);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.tools-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(31, 121, 113, 0.03) 0%, transparent 70%);
  animation: rotate 30s linear infinite;
  pointer-events: none;
}

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

/* Header Styles */
.tools-header {
  margin-bottom: 60px;
}

.tools-title {
  font-size: 3.5rem;
  font-weight: 700;
  color: #413e66;
  margin-bottom: 20px;
  line-height: 1.2;
}

.tools-subtitle {
  font-size: 1.3rem;
  color: #666;
  margin-bottom: 30px;
  font-weight: 300;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.tools-divider {
  width: 80px;
  height: 4px;
  background: linear-gradient(135deg, #1f7971, #26a69a);
  margin: 0 auto;
  border-radius: 2px;
}

/* Card Styles */
.tools-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(31, 121, 113, 0.1);
  margin-bottom: 40px;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.tools-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #1f7971, #26a69a, #d14715);
  transition: left 0.6s ease;
}

.tools-card:hover::before {
  left: 0;
}

.tools-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(31, 121, 113, 0.15);
}

/* Card Header */
.card-header {
  display: flex;
  align-items: center;
  padding: 30px;
  border-bottom: 1px solid #f0f0f0;
}

.card-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1f7971, #26a69a);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 20px;
  box-shadow: 0 4px 15px rgba(31, 121, 113, 0.3);
  transition: all 0.3s ease;
}

.tools-card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 25px rgba(31, 121, 113, 0.4);
}

.card-icon .material-icons {
  font-size: 28px;
  color: white;
}

.card-title-group {
  flex: 1;
}

.card-title {
  font-size: 2rem;
  color: #413e66;
  margin: 0 0 8px 0;
  font-weight: 600;
}

.card-description {
  color: #666;
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

/* Card Content */
.card-content {
  padding: 30px;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

/* Materials Gallery */
.materials-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-bottom: 20px;
}

.video-item {
  background: #f8f9fa;
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.video-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.video-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  border-radius: 15px 15px 0 0;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 15px 15px 0 0;
}

.video-info {
  padding: 20px;
}

.video-title {
  font-size: 1.1rem;
  color: #413e66;
  margin: 0 0 10px 0;
  font-weight: 600;
  line-height: 1.3;
}

.video-description {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}

/* Card Actions */
.card-actions {
  padding: 0 30px 30px;
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

/* Material Buttons */
.material-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
}

.material-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: width 0.6s, height 0.6s;
  transform: translate(-50%, -50%);
}

.material-btn:active::before {
  width: 300px;
  height: 300px;
}

.primary-btn {
  background: linear-gradient(135deg, #1f7971, #26a69a);
  color: white;
  box-shadow: 0 4px 15px rgba(31, 121, 113, 0.3);
  font-size: 16px;
}

.primary-btn:hover {
  background: linear-gradient(135deg, #165d56, #1e8a7a);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(31, 121, 113, 0.4);
  text-decoration: none;
  color: white;
}

.secondary-btn {
  background: linear-gradient(135deg, #413e66, #524a7a);
  color: white;
  box-shadow: 0 4px 15px rgba(65, 62, 102, 0.3);
  font-size: 16px;
}

.secondary-btn:hover {
  background: linear-gradient(135deg, #363156, #453e68);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(65, 62, 102, 0.4);
  text-decoration: none;
  color: white;
}

.accent-btn {
  background: linear-gradient(135deg, #d14715, #ff6b35);
  color: white;
  box-shadow: 0 4px 15px rgba(209, 71, 21, 0.3);
  font-size: 16px;
}

.accent-btn:hover {
  background: linear-gradient(135deg, #b83c11, #e55a2b);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(209, 71, 21, 0.4);
  text-decoration: none;
  color: white;
}

/* Quick Tools */
.quick-tools {
  margin-top: 60px;
  text-align: center;
}

.quick-tools-title {
  font-size: 2rem;
  color: #413e66;
  margin-bottom: 30px;
  font-weight: 600;
}

.quick-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.quick-tool-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: white;
  border-radius: 15px;
  text-decoration: none;
  color: #413e66;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.quick-tool-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(31, 121, 113, 0.15);
  text-decoration: none;
  color: #1f7971;
}

.quick-tool-item .material-icons {
  font-size: 32px;
  color: #1f7971;
  transition: all 0.3s ease;
}

.quick-tool-item:hover .material-icons {
  transform: scale(1.2);
}

.quick-tool-item span {
  font-weight: 500;
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .tools-title {
    font-size: 2.5rem;
  }
  
  .tools-subtitle {
    font-size: 1.1rem;
  }
  
  .card-header {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  
  .card-icon {
    margin-right: 0;
    margin-bottom: 15px;
  }
  
  .card-content {
    padding: 20px;
  }
  
  .video-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .quick-tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  
  .material-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .tools-section {
    padding: 60px 0;
  }
  
  .tools-header {
    margin-bottom: 40px;
  }
  
  .tools-card {
    margin-bottom: 30px;
    border-radius: 15px;
  }
  
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .quick-tools-grid {
    grid-template-columns: 1fr;
  }
}

/* Dark Mode Support */
body.theme-dark .tools-section {
  background: linear-gradient(135deg, #1e1e1e 0%, #2e2e2e 100%);
}

body.theme-dark .tools-card {
  background: #333;
  color: #e0e0e0;
}

body.theme-dark .card-title,
body.theme-dark .quick-tools-title,
body.theme-dark .video-title {
  color: #e0e0e0;
}

body.theme-dark .card-description,
body.theme-dark .video-description {
  color: #b0b0b0;
}

body.theme-dark .quick-tool-item {
  background: #404040;
  color: #e0e0e0;
}

body.theme-dark .video-item {
  background: #404040;
}

/* Performance Optimizations */
.tools-card,
.video-item,
.quick-tool-item {
  will-change: transform;
}

/* Accessibility Improvements */
.material-btn:focus,
.quick-tool-item:focus {
  outline: 3px solid #1f7971;
  outline-offset: 2px;
}

/* Loading States */
.video-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1f7971;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-wrapper.loading::after {
  opacity: 1;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}
