/**
 * Tools Feature Styles
 * 
 * Styles specific to Tools pages (Import/Export, etc.)
 * Uses design tokens from core/_variables.css
 * 
 * @since 3.0.0
 */

/* ============================================
   IMPORT/EXPORT PAGE
   ============================================ */

.prorank-import-export-page {
  margin: -20px -20px 0 -20px !important; /* Remove WordPress admin padding */
  width: calc(100% + 40px) !important;
  max-width: none !important;
  padding: 0 !important;
}

.prorank-import-export-page .prorank-content {
  margin-top: var(--prorank-spacing-5);
}

/* Tool Cards Grid */
.prorank-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--prorank-spacing-5);
  margin-bottom: var(--prorank-spacing-8);
}

.prorank-tools-grid .prorank-card {
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.prorank-tools-grid .prorank-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--prorank-shadow-lg);
}

/* Export Section */
.prorank-export-section {
  display: flex;
  flex-direction: column;
  gap: var(--prorank-spacing-4);
}

.prorank-export-section p {
  color: var(--prorank-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--prorank-spacing-3);
}

.prorank-export-section .prorank-select {
  margin-bottom: var(--prorank-spacing-4);
}

/* Import Section */
.prorank-import-section {
  display: flex;
  flex-direction: column;
  gap: var(--prorank-spacing-4);
}

.prorank-import-section p {
  color: var(--prorank-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--prorank-spacing-3);
}

/* File Upload Area */
.prorank-file-upload-area {
  margin: var(--prorank-spacing-4) 0;
  padding: var(--prorank-spacing-5);
  background: var(--prorank-bg-secondary);
  border: 2px dashed var(--prorank-border-color);
  border-radius: var(--prorank-radius-lg);
  text-align: center;
  transition: all 0.3s ease;
}

.prorank-file-upload-area:hover {
  border-color: var(--prorank-primary);
  background: var(--prorank-bg-primary);
}

.prorank-file-upload-area.has-file {
  border-style: solid;
  border-color: var(--prorank-success);
  background: var(--prorank-success-bg);
}

.prorank-file-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--prorank-spacing-2);
  color: var(--prorank-success);
  margin-top: var(--prorank-spacing-3);
  font-weight: 500;
}

.prorank-file-info .file-icon {
  font-size: 20px;
}

.prorank-file-info .file-size {
  color: var(--prorank-text-secondary);
  font-size: var(--prorank-font-sm);
  font-weight: normal;
}

/* Reset Settings Section */
.prorank-reset-section {
  margin-top: var(--prorank-spacing-8);
  padding-top: var(--prorank-spacing-8);
  border-top: 2px solid var(--prorank-border-color);
}

.prorank-reset-section .prorank-card {
  border: 2px solid var(--prorank-error-light);
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}

.prorank-reset-section .prorank-card-header {
  background: transparent;
  border-bottom: 1px solid var(--prorank-error-light);
}

.prorank-reset-section h2 {
  color: var(--prorank-error);
}

.prorank-reset-section .prorank-notice {
  margin-bottom: var(--prorank-spacing-4);
}

/* ============================================
   TOOL STATUS INDICATORS
   ============================================ */

.prorank-tool-status {
  display: inline-flex;
  align-items: center;
  gap: var(--prorank-spacing-2);
  padding: var(--prorank-spacing-1) var(--prorank-spacing-3);
  background: var(--prorank-bg-secondary);
  border-radius: var(--prorank-radius-full);
  font-size: var(--prorank-font-sm);
  font-weight: 500;
}

.prorank-tool-status.active {
  background: var(--prorank-success-bg);
  color: var(--prorank-success);
}

.prorank-tool-status.inactive {
  background: var(--prorank-error-bg);
  color: var(--prorank-error);
}

.prorank-tool-status.processing {
  background: var(--prorank-warning-bg);
  color: var(--prorank-warning);
}

.prorank-tool-status .status-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.prorank-tool-status.processing .status-icon {
  animation: pulse 1.5s infinite;
}

/* ============================================
   TOOL ACTIONS
   ============================================ */

.prorank-tool-actions {
  display: flex;
  gap: var(--prorank-spacing-3);
  margin-top: var(--prorank-spacing-4);
  padding-top: var(--prorank-spacing-4);
  border-top: 1px solid var(--prorank-border-color);
}

.prorank-tool-actions .prorank-button {
  flex: 1;
}

@media (max-width: 480px) {
  .prorank-tool-actions {
    flex-direction: column;
  }
}

/* ============================================
   PROGRESS INDICATORS
   ============================================ */

.prorank-import-progress,
.prorank-export-progress {
  margin-top: var(--prorank-spacing-4);
  padding: var(--prorank-spacing-4);
  background: var(--prorank-bg-secondary);
  border-radius: var(--prorank-radius-md);
  display: none;
}

.prorank-import-progress.active,
.prorank-export-progress.active {
  display: block;
}

.prorank-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--prorank-spacing-3);
}

.prorank-progress-title {
  font-weight: 600;
  color: var(--prorank-text-primary);
}

.prorank-progress-percentage {
  font-size: var(--prorank-font-sm);
  color: var(--prorank-text-secondary);
}

.prorank-progress-bar-wrapper {
  height: 8px;
  background: var(--prorank-bg-tertiary);
  border-radius: var(--prorank-radius-full);
  overflow: hidden;
}

.prorank-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--prorank-primary) 0%, var(--prorank-primary-dark) 100%);
  border-radius: var(--prorank-radius-full);
  transition: width 0.3s ease;
}

.prorank-progress-message {
  margin-top: var(--prorank-spacing-3);
  font-size: var(--prorank-font-sm);
  color: var(--prorank-text-secondary);
}

/* ============================================
   TOOL CARDS SPECIAL STATES
   ============================================ */

.prorank-tool-card {
  position: relative;
  overflow: hidden;
}

.prorank-tool-card.premium::before {
  content: "PRO";
  position: absolute;
  top: 12px;
  right: -24px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: white;
  padding: 2px 30px;
  font-size: 11px;
  font-weight: 700;
  transform: rotate(45deg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.prorank-tool-card.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.prorank-tool-card.disabled::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.5);
}

/* ============================================
   TOOL TIPS & HELP
   ============================================ */

.prorank-tool-tip {
  display: inline-block;
  margin-left: var(--prorank-spacing-2);
  width: 16px;
  height: 16px;
  background: var(--prorank-text-muted);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 16px;
  font-size: 12px;
  cursor: help;
  position: relative;
}

.prorank-tool-tip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--prorank-spacing-2) var(--prorank-spacing-3);
  background: var(--prorank-text-primary);
  color: white;
  border-radius: var(--prorank-radius-sm);
  font-size: var(--prorank-font-sm);
  white-space: nowrap;
  margin-bottom: var(--prorank-spacing-1);
  box-shadow: var(--prorank-shadow-lg);
  z-index: 1000;
}

.prorank-tool-tip:hover::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: var(--prorank-text-primary);
  margin-bottom: -3px;
  z-index: 1001;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .prorank-tools-grid {
    grid-template-columns: 1fr;
  }

  .prorank-import-export-page {
    padding: var(--prorank-spacing-3);
  }

  .prorank-file-upload-area {
    padding: var(--prorank-spacing-4);
  }

  .prorank-reset-section {
    margin-top: var(--prorank-spacing-6);
    padding-top: var(--prorank-spacing-6);
  }
}

@media (max-width: 480px) {
  .prorank-tool-actions {
    flex-direction: column;
  }

  .prorank-tool-actions .prorank-button {
    width: 100%;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

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

.prorank-tool-loading {
  display: inline-block;
  animation: spin 1s linear infinite;
}