/* admin/css/settings.css */

/* General Layout & Components */
.memberstack-settings-wrap {
  margin: 20px 0;
}

.memberstack-settings-wrap h1 {
  margin-bottom: 15px;
}

.memberstack-notice {
  margin-left: 10px;
}

/* Quick Actions Bar */
.memberstack-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.memberstack-quick-actions .button {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* Tab Navigation */
.nav-tab-wrapper {
  margin-bottom: 20px;
  border-bottom: 1px solid #c3c4c7;
  padding-top: 0;
}

.nav-tab-wrapper .nav-tab {
  margin-left: 0;
  margin-right: 0.5em;
  padding: 8px 15px;
  font-size: 14px;
  line-height: 1.71428571;
  font-weight: 500;
  background: #f0f0f1;
  border: 1px solid #c3c4c7;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}

.nav-tab-wrapper .nav-tab:hover {
  background: #f0f0f1;
  color: #1d2327;
}

.nav-tab-wrapper .nav-tab-active,
.nav-tab-wrapper .nav-tab-active:hover {
  margin-bottom: -1px;
  background: #ffffff;
  border-bottom: 1px solid #fff;
  color: #000;
  outline: none;
  box-shadow: none;
}

/* Tab Content */
.tab-content {
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: 0 0 0 4px;
  padding: 20px;
  margin-top: -1px;
}

/* Success Message */
.app-id-success {
  margin-top: 0;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: #e6f4ea;
  border-left: 4px solid #28a745;
  border-radius: 3px;
}

.app-id-success .dashicons-yes-alt {
  color: #28a745;
  font-size: 20px;
}

/* Section Layouts - Common Styles */
.memberstack-gated-content-section,
.memberstack-addons-section,
.memberstack-faqs-section,
.memberstack-shortcodes-section,
.memberstack-setup-card {
  background: #fff;
  padding: 20px;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
}

.memberstack-settings-form,
.memberstack-video-guide {
  background: #fff;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
}

.memberstack-form-content,
.video-guide-content {
  padding: 20px;
}

/* Settings Grid Layout */
.memberstack-settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-top: 20px;
}

@media (min-width: 782px) {
  .memberstack-settings-grid {
    grid-template-columns: minmax(300px, 1fr) minmax(300px, 560px);
    align-items: start;
  }
}

/* Form Elements */
.form-table {
  margin-top: 0;
}

.form-table th {
  padding: 20px 10px 20px 0;
  width: 200px;
}

.form-table td {
  padding: 20px 10px;
}

.regular-text {
  width: 100%;
  max-width: 400px;
}

/* Description Text */
.description {
  margin-top: 8px;
  color: #646970;
}

.memberstack-gated-content-section .description,
.memberstack-addons-section .description,
.memberstack-faqs-section .description {
  margin-bottom: 20px;
  color: #646970;
}

/* Submit Button */
.submit {
  margin-top: 20px;
  padding: 0;
}

/* Setup Steps */
.memberstack-setup-steps {
  margin: 20px 0;
  flex: 1;
}

.setup-step {
  display: flex;
  align-items: flex-start;
  margin-bottom: 15px;
}

.step-number {
  background: #0073aa;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-weight: bold;
  flex-shrink: 0;
}

.setup-step p {
  margin: 0;
  line-height: 1.6;
}

/* App ID Input Form */
.app-id-input-container {
  margin: 15px 0;
}

.app-id-field-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Video Container */
.memberstack-settings-form,
.memberstack-video-guide {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.memberstack-settings-form h3,
.memberstack-video-guide h3 {
  margin-top: 0;
  margin-bottom: 15px;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin-top: auto;
  border-radius: 4px;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Tables for Gated Content and Add-ons */

table.plugins tr {
  background: transparent;
}

.memberstack-gated-content-section table,
.memberstack-addons-section table {
  margin-top: 10px;
  border: 1px solid #ccd0d4;
  border-radius: 4px;
}

.memberstack-gated-content-section th,
.memberstack-gated-content-section td {
  padding: 12px;
}

.memberstack-gated-content-section tr:nth-child(even) {
  background: #f9f9f9;
}

.memberstack-addons-section table .check-column {
  padding: 8px 10px;
}

/* Gated Content Refresh Button */
.refresh-section {
  display: flex;
  align-items: center;
  gap: 20px;
}

#gated-content-refresh {
  display: flex;
  align-items: center;
  gap: 5px;
}

#gated-content-refresh .dashicons {
  margin-right: 5px;
}

.memberstack-last-refresh {
  font-size: 14px;
  color: #555;
}

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

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

/* Shortcodes Documentation Styles */
.memberstack-shortcodes-docs {
  max-width: 800px;
  margin: 20px 0;
}

.memberstack-shortcodes-docs h3,
.memberstack-shortcodes-section h3 {
  margin: 25px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
  font-size: 1.3em;
  color: #1d2327;
}

.memberstack-shortcodes-docs code,
.memberstack-shortcodes-section code {
  background: #f6f7f7;
  padding: 3px 5px;
  border-radius: 3px;
  font-size: 13px;
}

.memberstack-shortcodes-docs pre,
.memberstack-shortcodes-section pre {
  background: #f6f7f7;
  padding: 15px;
  border-radius: 4px;
  border: 1px solid #ddd;
  overflow-x: auto;
  margin: 10px 0;
  font-family: Consolas, Monaco, monospace;
}

.memberstack-shortcodes-docs ul,
.memberstack-shortcodes-section ul {
  list-style-type: disc;
  margin-left: 20px;
  margin-bottom: 15px;
}

.memberstack-shortcodes-docs li,
.memberstack-shortcodes-section li {
  margin: 5px 0;
  line-height: 1.4;
}

.memberstack-shortcodes-docs p,
.memberstack-shortcodes-section p {
  margin: 1em 0;
  line-height: 1.5;
}

.contextual-help-tabs-wrap .memberstack-shortcodes-docs {
  margin: 0;
}

.contextual-help-tabs-wrap .memberstack-shortcodes-docs pre {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.memberstack-shortcodes-section h2 {
  margin-top: 0;
  margin: 1em 0;
}

.shortcode-example {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 15px;
  margin: 10px 0;
}

.shortcode-example .title {
  font-weight: 600;
  margin-bottom: 10px;
  color: #1d2327;
}

/* Gated Content List Styles */
.memberstack-gated-content-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.memberstack-gated-content-section li {
  margin-bottom: 5px;
}

.memberstack-gated-content-section li:last-child {
  margin-bottom: 0;
}

/* FAQ Section */
.memberstack-faqs ul {
  margin: 0 0 20px 40px;
  list-style-type: disc;
}

.memberstack-faqs li {
  margin-bottom: 8px;
}

/* Videos Tab */
.memberstack-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.memberstack-video-item {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  background-color: #fff;
  transition: box-shadow 0.3s ease;
}

.memberstack-video-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.memberstack-video-item a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.memberstack-video-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9; /* Maintain aspect ratio */
  object-fit: cover;
}

.memberstack-video-item h3 {
  margin: 0;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* Responsive Adjustments */
@media screen and (max-width: 782px) {
  .form-table td {
    padding: 15px 10px;
  }

  .nav-tab-wrapper .nav-tab {
    margin-bottom: 5px;
  }

  .memberstack-video-guide {
    margin-top: 20px;
  }

  .app-id-field-wrapper {
    flex-direction: column;
    gap: 10px;
  }

  .app-id-field-wrapper input {
    margin-bottom: 10px;
  }
}
