/* ========================================
   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: all 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;
}

.rsg-gallery-item:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1) !important;
  border-color: #d1d5db !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: #f3f4f6 !important;
  border: 2px dashed #d1d5db !important;
  border-radius: 12px !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
   ======================================== */

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

/* Hero Section */
.rsg-upgrade-hero {
  text-align: center;
  padding: 60px 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  color: #fff;
  margin-bottom: 50px;
  box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
}

.rsg-upgrade-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.rsg-upgrade-badge .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  color: #fbbf24;
}

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

.rsg-upgrade-description {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  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.15);
  padding: 24px 40px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.rsg-price-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  color: #fbbf24;
}

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

.rsg-price-old {
  font-size: 28px;
  text-decoration: line-through;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 500;
}

.rsg-price-new {
  font-size: 56px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.rsg-price-save {
  background: #10b981;
  color: #fff;
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
}

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

.rsg-btn-upgrade-primary,
.rsg-btn-upgrade-secondary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.rsg-btn-upgrade-primary {
  background: #fff;
  color: #667eea;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.rsg-btn-upgrade-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  color: #667eea;
}

.rsg-btn-upgrade-secondary {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.rsg-btn-upgrade-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  color: #fff;
}

.rsg-btn-upgrade-primary .dashicons,
.rsg-btn-upgrade-secondary .dashicons {
  font-size: 20px;
  width: 20px;
  height: 20px;
}

/* Features Grid */
.rsg-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.rsg-feature-card {
  background: #fff;
  padding: 32px 24px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  text-align: center;
  transition: all 0.3s ease;
}

.rsg-feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  border-color: #667eea;
}

.rsg-feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.rsg-feature-icon .dashicons {
  font-size: 32px;
  width: 32px;
  height: 32px;
  color: #fff;
}

.rsg-feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 12px 0;
}

.rsg-feature-card p {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.6;
}

/* Responsive Design for Upgrade Page */
@media (max-width: 768px) {
  .rsg-upgrade-hero {
    padding: 40px 24px;
  }

  .rsg-upgrade-title {
    font-size: 32px;
  }

  .rsg-upgrade-description {
    font-size: 16px;
  }

  .rsg-price-new {
    font-size: 42px;
  }

  .rsg-upgrade-actions {
    flex-direction: column;
  }

  .rsg-btn-upgrade-primary,
  .rsg-btn-upgrade-secondary {
    width: 100%;
    justify-content: center;
  }

  .rsg-features-grid {
    grid-template-columns: 1fr;
  }
}

/* ========================================
   HIDE PERMALINK SECTION - ONLY ON PLUGIN PAGES
   ======================================== */

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

