/* Elementor Code Preview Styles */
.ecp-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: #ffffff;
  min-height: 100vh;
  font-family: "Vazir", Arial, sans-serif;
}

.ecp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.ecp-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ecp-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.ecp-card-header {
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ecp-html-card .ecp-card-header {
  background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
}

.ecp-css-card .ecp-card-header {
  background: linear-gradient(135deg, #f9f9f9 0%, #e9e9e9 100%);
}

.ecp-js-card .ecp-card-header {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.ecp-card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ecp-icon {
  font-size: 20px;
}

.ecp-copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.ecp-copy-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.ecp-card-content {
  padding: 20px;
}

.ecp-card-content label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  color: #374151;
}

.ecp-textarea {
  width: 100%;
  height: 150px;
  padding: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  font-family: "Courier New", monospace;
  font-size: 14px;
  resize: vertical;
  transition: border-color 0.2s ease;
  background-color: #fafafa;
}

.ecp-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  background-color: #ffffff;
}

/* Added styles for readonly textareas and admin warning */
.ecp-textarea[readonly] {
  background-color: #f3f4f6;
  color: #6b7280;
  cursor: not-allowed;
  border-color: #d1d5db;
}

.ecp-textarea[readonly]:focus {
  border-color: #d1d5db;
  background-color: #f3f4f6;
}

.ecp-container p[style*="color: #e74c3c"] {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 20px;
  text-align: center;
}

.ecp-preview-section {
  text-align: center;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.ecp-preview-button {
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  width: 200px;
  height: 56px;
  justify-content: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin: 0;
}

.ecp-preview-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.ecp-preview-button:active {
  transform: translateY(0);
}

/* Added specific styles to prevent button size changes during loading */
.ecp-preview-button[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  width: 200px;
  height: 56px;
}

.ecp-preview-button[disabled]:hover {
  transform: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Admin Styles */
.wrap #ecp-admin-container {
  margin-top: 20px;
}

#ecp-admin-container .ecp-container {
  background: #f1f1f1;
  border-radius: 8px;
  padding: 20px;
}

.ecp-admin-button {
  margin-right: 10px;
  background-color: #e74c3c !important;
}

.ecp-admin-button:hover {
  background-color: #c0392b !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .ecp-container {
    padding: 15px;
  }

  .ecp-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .ecp-card-header,
  .ecp-card-content {
    padding: 15px;
  }

  .ecp-textarea {
    height: 120px;
  }

  .ecp-preview-button {
    padding: 12px 24px;
    font-size: 16px;
    width: 180px;
    height: 48px;
  }

  .ecp-admin-button {
    margin-right: 0;
    margin-top: 10px;
    display: block;
    width: 100%;
  }
}

/* Completely removed bottom margins and padding from widget container */
.elementor-code-preview-widget {
  margin: 0;
  padding: 0;
  line-height: 0;
}

.elementor-code-preview-widget .ecp-container {
  margin: 0;
  padding: 0;
  min-height: auto;
}

/* Added specific rule to remove any bottom spacing */
.elementor-code-preview-widget::after,
.ecp-container::after,
.ecp-preview-section::after {
  content: none;
  display: none;
}
