/* ========================================
   RSG PLUGIN - CLEAN ADMIN STYLES
   All styles prefixed with .rsg- to avoid conflicts
   ======================================== */

/* Main Container */
.rsg-settings-dashboard {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f9fafb;
  color: #1f2937;
  margin: 20px 20px 0 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.rsg-modern-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* ========================================
   TAB NAVIGATION
   ======================================== */

.rsg-tab-navigation {
  display: flex;
  background: #f8f9fa;
  border-bottom: 2px solid #e5e7eb;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  flex-wrap: wrap;
}

.rsg-tab-btn {
  flex: 1;
  min-width: 140px;
  padding: 16px 20px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.rsg-tab-btn .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
}

.rsg-tab-btn:hover {
  background: #fff;
  color: #3b82f6;
}

.rsg-tab-btn.active {
  background: #fff;
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.rsg-tab-btn.rsg-tab-pro {
  color: #f59e0b;
}

.rsg-tab-btn.rsg-tab-pro:hover,
.rsg-tab-btn.rsg-tab-pro.active {
  color: #d97706;
  border-bottom-color: #f59e0b;
}

/* ========================================
   TAB CONTENT
   ======================================== */

.rsg-tab-content-wrapper {
  padding: 0;
}

.rsg-tab-pane {
  display: none;
  padding: 30px;
  animation: rsgFadeIn 0.3s ease;
}

.rsg-tab-pane.active {
  display: block;
}

@keyframes rsgFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   HEADER SECTIONS
   ======================================== */

.rsg-header {
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.rsg-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 8px 0;
}

.rsg-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* ========================================
   BUTTONS
   ======================================== */

.rsg-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.rsg-btn-primary {
  background-color: #3b82f6 !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  padding: 10px 20px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.rsg-btn-primary:hover {
  background-color: #2563eb !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.rsg-btn-danger {
  background-color: transparent !important;
  color: #ef4444 !important;
  border: 1px solid #fee2e2 !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  padding: 10px 20px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.rsg-btn-danger:hover {
  background-color: #fee2e2 !important;
  border-color: #fecaca !important;
  color: #dc2626 !important;
}

/* ========================================
   IMAGE GALLERY GRID
   ======================================== */

.rsg-gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 15px !important;
  padding: 20px 0 !important;
  margin: 0 !important;
  list-style: none !important;
  width: 100% !important;
  max-width: 100% !important;
}

.rsg-gallery-item {
  background: #fff !important;
  border-radius: 12px !important;
  border: 1px solid #e5e7eb !important;
  padding: 12px !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
  list-style: none !important;
  display: block !important;
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  cursor: grab !important;
  user-select: none !important;
}

.rsg-gallery-item:active {
  cursor: grabbing !important;
}

.rsg-gallery-item:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1) !important;
  border-color: #d1d5db !important;
}

.ui-sortable-helper.rsg-gallery-item {
  cursor: grabbing !important;
  z-index: 1000 !important;
  transition: none !important;
  transform: scale(1.05) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.rsg-slide-image-wrapper {
  position: relative !important;
  padding-top: 75% !important;
  background: #f3f4f6 !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  margin-bottom: 12px !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

.rsg-slide-image {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  border: none !important;
}

.rsg-slide-title {
  width: 100% !important;
  border: 1px solid #d1d5db !important;
  border-radius: 6px !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  color: #374151 !important;
  background: #f9fafb !important;
  display: block !important;
  box-sizing: border-box !important;
}

.rsg-slide-title:focus {
  background: #fff !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
  outline: none !important;
}

.rsg-delete-btn {
  width: 32px !important;
  height: 32px !important;
  background: rgba(255, 255, 255, 0.95) !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  color: #ef4444 !important;
  transition: all 0.2s !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  text-decoration: none !important;
  z-index: 10 !important;
  border: 2px solid #fff !important;
}

.rsg-delete-btn .dashicons {
  font-size: 16px !important;
  width: 16px !important;
  height: 16px !important;
  line-height: 1 !important;
}

.rsg-delete-btn:hover {
  background: #ef4444 !important;
  color: #fff !important;
  transform: scale(1.15) !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
}

/* ========================================
   SETTINGS FIELDS
   ======================================== */

.rsg-field-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.rsg-field-group:hover {
  border-color: #d1d5db;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.rsg-field-label {
  flex: 1;
  padding-right: 20px;
}

.rsg-field-label h6 {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 4px 0;
}

.rsg-field-label p {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

.rsg-field-input {
  flex-shrink: 0;
}

.rsg-field-input input[type="text"],
.rsg-field-input input[type="number"] {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  width: 120px;
  transition: all 0.2s ease;
}

.rsg-field-input input[type="text"]:focus,
.rsg-field-input input[type="number"]:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

/* Switch Field (Radio Buttons) */
.switch-field {
  display: flex;
  gap: 8px;
  background: #f3f4f6;
  padding: 4px;
  border-radius: 8px;
}

.switch-field input[type="radio"] {
  display: none;
}

.switch-field label {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0;
}

.switch-field input[type="radio"]:checked + label {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.switch-field label:hover {
  color: #3b82f6;
}

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

@media (min-width: 1600px) {
  .rsg-gallery-grid {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}

@media (min-width: 1200px) and (max-width: 1599px) {
  .rsg-gallery-grid {
    grid-template-columns: repeat(5, 1fr) !important;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .rsg-gallery-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 767px) {
  .rsg-tab-navigation {
    flex-direction: column;
  }

  .rsg-tab-btn {
    min-width: 100%;
    justify-content: flex-start;
    padding-left: 30px;
  }

  .rsg-tab-pane {
    padding: 20px 15px;
  }

  .rsg-gallery-grid {
    grid-template-columns: repeat(1, 1fr) !important;
    gap: 16px !important;
  }

  .rsg-field-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .rsg-field-label {
    padding-right: 0;
    margin-bottom: 12px;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

#slider-gallery {
  width: 100%;
  display: block;
  clear: both;
}

.ui-sortable-placeholder {
  visibility: visible !important;
  background: #f8fafc !important;
  border: 2px dashed #94a3b8 !important;
  border-radius: 12px !important;
  box-sizing: border-box !important;
  grid-column: span 1 / auto !important;
  margin: 0 !important;
  height: auto !important;
  min-height: 100px !important;
}

/* ========================================
   OVERRIDE ANY CONFLICTING STYLES
   ======================================== */

/* Reset WordPress/Theme overrides */
.rsg-settings-dashboard * {
  box-sizing: border-box;
}

.rsg-settings-dashboard img {
  max-width: 100% !important;
  height: auto !important;
}

/* Prevent Astra/other themes from overriding */
.rsg-gallery-grid,
.rsg-gallery-grid li,
.rsg-gallery-item {
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  clear: none !important;
}

.rsg-gallery-item {
  padding: 12px !important;
}

/* Force grid layout */
ul.rsg-gallery-grid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
}

/* Prevent image distortion */
.rsg-slide-image-wrapper img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  max-width: none !important;
  max-height: none !important;
}

/* ========================================
   UPGRADE PAGE STYLES
   ======================================== */

/* ========================================
   UPGRADE PAGE STYLES - SIMPLIFIED & CLEAN
   ======================================== */

.rsg-upgrade-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Hero Section */
.rsg-upgrade-hero {
    text-align: center;
    padding: 60px 40px;
    background: #1e293b;
    border-radius: 12px;
    color: #fff;
    margin-bottom: 40px;
}

.rsg-upgrade-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fbbf24;
}

.rsg-upgrade-title {
    font-size: 40px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #fff;
}

.rsg-upgrade-description {
    font-size: 18px;
    color: #94a3b8;
    margin: 0 0 40px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Pricing Box */
.rsg-pricing-box {
    margin-bottom: 40px;
}

.rsg-price-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    padding: 24px 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rsg-price-amount {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.rsg-price-old {
    font-size: 24px;
    text-decoration: line-through;
    color: #64748b;
}

.rsg-price-new {
    font-size: 48px;
    font-weight: 700;
    color: #fff;
}

/* Upgrade Buttons */
.rsg-upgrade-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.rsg-btn-upgrade-primary,
.rsg-btn-upgrade-secondary {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.rsg-btn-upgrade-primary {
    background: #3b82f6;
    color: #fff;
}

.rsg-btn-upgrade-primary:hover {
    background: #2563eb;
    color: #fff;
}

.rsg-btn-upgrade-secondary {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.rsg-btn-upgrade-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Simplified Feature Grid */
.rsg-upgrade-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 60px;
}

.rsg-feature-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    gap: 16px;
    transition: all 0.2s ease;
}

.rsg-feature-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.rsg-feature-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: #eff6ff;
    color: #3b82f6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rsg-feature-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.rsg-feature-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1e293b;
}

.rsg-feature-content p {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* Comparison Section */
.rsg-comparison-section {
    margin-top: 60px;
}

.rsg-section-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 40px;
    color: #1e293b;
}

.rsg-comparison-table-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.rsg-comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.rsg-comparison-table th {
    background: #f8fafc;
    padding: 16px 24px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}

.rsg-comparison-table th:not(:first-child),
.rsg-comparison-table td:not(:first-child) {
    text-align: center;
}

.rsg-comparison-table td {
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 15px;
    color: #334155;
}

.rsg-comparison-table tr:last-child td {
    border-bottom: none;
}

.rsg-check-icon { color: #10b981; }
.rsg-cross-icon { color: #cbd5e1; }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .rsg-upgrade-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .rsg-upgrade-grid { grid-template-columns: 1fr; }
    .rsg-upgrade-hero { padding: 40px 20px; }
    .rsg-upgrade-title { font-size: 32px; }
    .rsg-comparison-table-container { overflow-x: auto; }
}

/* Hide permalink section on plugin pages */
.post-type-responsive_slider #edit-slug-box {
    display: none !important;
}

/* Return to top button */
.rsg-return-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: #3b82f6;
    color: #fff !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.rsg-return-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rsg-return-to-top:hover {
    background: #2563eb;
    transform: translateY(-4px);
}

.rsg-return-to-top .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}
