/**
 * =================================================================
 * KANBAN SISZAPP - ADVANCED FEATURES STYLES
 * =================================================================
 * Estilos para funcionalidades avançadas
 * =================================================================
 */

/* ============================================
   GLOBAL SEARCH MODAL
   ============================================ */
.global-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  animation: fadeIn 0.2s ease;
}

.global-search-modal {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: slideDown 0.3s ease;
}

.dark .global-search-modal {
  background: #1e293b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

/* Search Input */
.global-search-input-wrapper {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dark .global-search-input-wrapper {
  border-bottom-color: #334155;
}

.global-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 18px;
  background: transparent;
  color: #1f2937;
}

.dark .global-search-input {
  color: #f1f5f9;
}

.global-search-input::placeholder {
  color: #9ca3af;
}

/* Search Results */
.global-search-results {
  overflow-y: auto;
  max-height: calc(80vh - 80px);
  padding: 8px;
}

.search-result-item {
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid transparent;
}

.search-result-item:hover,
.search-result-item.selected {
  background: #f3f4f6;
  border-color: #3b82f6;
}

.dark .search-result-item:hover,
.dark .search-result-item.selected {
  background: #334155;
  border-color: #60a5fa;
}

.search-result-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: #1f2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dark .search-result-title {
  color: #f1f5f9;
}

.search-result-meta {
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dark .search-result-meta {
  color: #94a3b8;
}

/* Search Hint */
.search-hint {
  padding: 16px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

.dark .search-hint {
  color: #94a3b8;
}

.search-kbd {
  display: inline-block;
  padding: 2px 6px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
  margin: 0 2px;
}

.dark .search-kbd {
  background: #334155;
  border-color: #475569;
}

/* ============================================
   ADVANCED FILTERS PANEL
   ============================================ */
.filters-panel {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.dark .filters-panel {
  background: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.filters-title {
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dark .filters-title {
  color: #f1f5f9;
}

.filters-badge {
  background: #3b82f6;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dark .filter-label {
  color: #94a3b8;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 2px solid #e5e7eb;
  background: white;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.dark .filter-pill {
  border-color: #475569;
  background: #334155;
  color: #f1f5f9;
}

.filter-pill:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

.dark .filter-pill:hover {
  border-color: #60a5fa;
  background: #1e3a8a;
}

.filter-pill.active {
  border-color: #3b82f6;
  background: #3b82f6;
  color: white;
}

.dark .filter-pill.active {
  border-color: #60a5fa;
  background: #60a5fa;
}

/* ============================================
   ACTIVITY HISTORY
   ============================================ */
.activity-timeline {
  position: relative;
  padding-left: 40px;
}

.activity-timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #e5e7eb, transparent);
}

.dark .activity-timeline::before {
  background: linear-gradient(to bottom, #475569, transparent);
}

.activity-item {
  position: relative;
  padding-bottom: 24px;
  animation: slideInLeft 0.3s ease;
}

.activity-item:last-child {
  padding-bottom: 0;
}

.activity-icon {
  position: absolute;
  left: -30px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: 3px solid #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  z-index: 1;
}

.dark .activity-icon {
  background: #1e293b;
  border-color: #60a5fa;
}

.activity-content {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.dark .activity-content {
  background: #334155;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.activity-content:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.activity-user {
  font-weight: 600;
  color: #1f2937;
}

.dark .activity-user {
  color: #f1f5f9;
}

.activity-action {
  color: #6b7280;
  font-size: 14px;
}

.dark .activity-action {
  color: #94a3b8;
}

.activity-time {
  font-size: 12px;
  color: #9ca3af;
}

.dark .activity-time {
  color: #64748b;
}

.activity-details {
  color: #4b5563;
  font-size: 14px;
  margin-top: 8px;
}

.dark .activity-details {
  color: #cbd5e1;
}

/* ============================================
   NOTIFICATIONS PANEL
   ============================================ */
.notifications-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 400px;
  max-width: 90vw;
  background: white;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  animation: slideDown 0.2s ease;
}

.dark .notifications-dropdown {
  background: #1e293b;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.notifications-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dark .notifications-header {
  border-bottom-color: #334155;
}

.notifications-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.dark .notifications-title {
  color: #f1f5f9;
}

.notifications-list {
  max-height: 400px;
  overflow-y: auto;
}

.notification-item {
  padding: 16px 20px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.dark .notification-item {
  border-bottom-color: #334155;
}

.notification-item:hover {
  background: #f9fafb;
}

.dark .notification-item:hover {
  background: #334155;
}

.notification-item.unread {
  background: #eff6ff;
}

.dark .notification-item.unread {
  background: #1e3a8a;
}

.notification-item.unread::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b82f6;
}

.notification-content {
  display: flex;
  gap: 12px;
}

.notification-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.dark .notification-icon {
  background: #475569;
}

.notification-body {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
  font-size: 14px;
}

.dark .notification-title {
  color: #f1f5f9;
}

.notification-message {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
}

.dark .notification-message {
  color: #94a3b8;
}

.notification-time {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

.dark .notification-time {
  color: #64748b;
}

.notifications-empty {
  padding: 40px 20px;
  text-align: center;
  color: #9ca3af;
}

.dark .notifications-empty {
  color: #64748b;
}

/* ============================================
   TEMPLATES MODAL
   ============================================ */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
}

.template-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.dark .template-card {
  background: #1e293b;
  border-color: #475569;
}

.template-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.dark .template-card:hover {
  border-color: #60a5fa;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.template-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.template-title {
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}

.dark .template-title {
  color: #f1f5f9;
}

.template-description {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 12px;
}

.dark .template-description {
  color: #94a3b8;
}

.template-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #9ca3af;
}

.dark .template-meta {
  color: #64748b;
}

.template-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.template-card:hover .template-actions {
  opacity: 1;
}

/* ============================================
   EXPORT/IMPORT UI
   ============================================ */
.export-import-panel {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .export-import-panel {
  background: #1e293b;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.export-import-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.export-import-option {
  padding: 20px;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dark .export-import-option {
  border-color: #475569;
}

.export-import-option:hover {
  border-color: #3b82f6;
  background: #eff6ff;
  border-style: solid;
}

.dark .export-import-option:hover {
  border-color: #60a5fa;
  background: #1e3a8a;
}

.export-import-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.export-import-label {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.dark .export-import-label {
  color: #f1f5f9;
}

.export-import-hint {
  font-size: 12px;
  color: #6b7280;
}

.dark .export-import-hint {
  color: #94a3b8;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .global-search-modal {
    width: 95%;
    max-height: 90vh;
  }
  
  .notifications-dropdown {
    width: 100vw;
    max-width: 100vw;
    left: 0;
    right: 0;
    border-radius: 16px 16px 0 0;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
  }
  
  .templates-grid {
    grid-template-columns: 1fr;
  }
  
  .export-import-options {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   UTILITIES
   ============================================ */
.pulse-animation {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.dark .shimmer {
  background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
