/* ========== PRICING POPUP TOGGLE FIX ========== */
.pricePopup .toggle-switch {
    display: inline-block;
    position: relative;
    width: 178px;
    height: 34px;
    border: 1px solid #D1F0F0;
    border-radius: 4px;
    background-color: #F8FFFE;
}

.pricePopup .toggle-input {
    display: none;
}

.pricePopup .toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    width: 100%;
    height: 34px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #05ADA3;
    transition: background-color 0.3s, transform 0.3s;
    top: -1px;
}

.pricePopup .option {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    z-index: 2;
}

.pricePopup .toggle-label::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 0px;
    width: calc(51% - 5px);
    height: calc(100% - 6px);
    background-color: #05ADA3;
    border-radius: 4px;
    transform: scaleY(1.2);
    transition: left 0.3s, background-color 0.3s;
    z-index: 1;
}

.pricePopup .toggle-input:checked + .toggle-label::before {
    left: calc(50% + 3px);
}

.pricePopup .toggle-input:not(:checked) + .toggle-label .monthly {
    color: white;
}

.pricePopup .toggle-input:checked + .toggle-label .annually {
    color: white;
}

.pricePopup .toggleSec {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0px 25px;
}

.pricePopup .tooltip {
    position: absolute;
    top: -30px;
    right: -10px;
    background: #FF6B6B;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
}

.pricePopup .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #FF6B6B;
}
/* ========== END PRICING POPUP TOGGLE FIX ========== */

/* ========== AI TOOLS BANNER INTEGRATION STYLES ========== */
.ai-essay-writer-section {
  padding: 0;
  background: transparent;
  position: relative;
}

.essay-writer-wrapper {
    max-width: 1080px;
  margin: 0 auto;
  padding: 0;
  margin-top: 32px;
}

/* Form Card - Dark Theme */
.essay-form-card,
.topic-form-card {
background: #1a1a2e2e;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  padding: 32px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.essay-writer-form,
.topic-generator-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Input Group */
.ai-essay-writer-section .input-group {
  position: relative;
  z-index: 1;
}

/* Input Icons inside input field */
.input-icons {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
}

.input-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.input-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

/* CSS Tooltip for input icons */
.input-icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 100;
}

.input-icon-btn::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1e293b;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 100;
}

.input-icon-btn:hover::after,
.input-icon-btn:hover::before {
  opacity: 1;
  visibility: visible;
}

/* AI Suggest Button Styles */
.input-icon-btn.ai-suggest-btn.default {
  color: #14b8a6;
  background: rgba(20, 184, 166, 0.1);
}

.input-icon-btn.ai-suggest-btn.default:hover {
  background: rgba(20, 184, 166, 0.2);
  color: #14b8a6;
}

.input-icon-btn.ai-suggest-btn.processing {
  color: #14b8a6;
  background: rgba(20, 184, 166, 0.1);
  pointer-events: none;
}

.input-icon-btn.ai-suggest-btn.refresh {
  color: #14b8a6;
  background: rgba(20, 184, 166, 0.1);
}

.input-icon-btn.ai-suggest-btn.refresh:hover {
  background: rgba(20, 184, 166, 0.2);
  color: #14b8a6;
}

/* Spinning animation for processing state */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.ai-spinner {
  animation: spin 1s linear infinite;
}

.essay-topic-input,
.subject-input {
  width: 100%;
  padding: 13px 130px 13px 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 15px;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  outline: none;
  line-height: 1.6;
  box-sizing: border-box;
}

.essay-topic-input::placeholder,
.subject-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.essay-topic-input:hover,
.subject-input:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.essay-topic-input:focus,
.subject-input:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

/* Form Controls */
.ai-essay-writer-section .form-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-essay-writer-section .form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-essay-writer-section .form-group {
  flex: 1;
  min-width: 200px;
}

.ai-essay-writer-section .select-group {
  position: relative;
}

.ai-essay-writer-section .form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 14px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='rgba(255,255,255,0.6)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.ai-essay-writer-section .form-select:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.ai-essay-writer-section .form-select:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.ai-essay-writer-section .form-select option {
  padding: 8px;
  background: #1a1a2e;
  color: #ffffff;
}

/* Action Row */
.ai-essay-writer-section .action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

/* Toggle Switch */
.ai-essay-writer-section .toggle-group {
  flex: 0 0 auto;
  min-width: auto;
}
 .toggle-label::before {
   
    background-color: transparent !important;
 
  }
.ai-essay-writer-section .toggle-label {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 12px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}


.toggle-switch {
    display: unset!important;
    position: unset!important;  
     width: unset!important; 
    height: unset!important;
    border: unset!important;
    border-radius: unset!important;
    background-color: unset!important;
}
.ai-essay-writer-section .toggle-switch {
  position: relative !important;
  width: 44px !important;
  height: 20px !important;
  flex-shrink: 0 !important;
  order: -1 !important;
}
.ai-essay-writer-section .toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ai-essay-writer-section .toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
    background-color: rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  transition: 0.3s;
}

/* Dark theme toggle for main form */
.essay-form-card .toggle-slider {
  background-color: rgba(255, 255, 255, 0.25);
}

.ai-essay-writer-section .toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.ai-essay-writer-section .toggle-input:checked + .toggle-slider {
  background-color: #14b8a6;
}

.ai-essay-writer-section .toggle-input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.ai-essay-writer-section .toggle-switch.small {
  width: 36px;
  height: 20px;
}

.ai-essay-writer-section .toggle-switch.small .toggle-slider:before {
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
}

.ai-essay-writer-section .toggle-switch.small .toggle-input:checked + .toggle-slider:before {
  transform: translateX(16px);
}

/* Generate Button */
.ai-essay-writer-section .btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
        background: linear-gradient(180deg, #24C7BD 0%, #046761 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
  box-shadow: 0 4px 12px rgba(35, 63, 140, 0.25);
  flex-shrink: 0;
}

.ai-essay-writer-section .btn-generate:hover {
  transform: translateY(-2px);
     background: linear-gradient(180deg, #046761 0%, #24C7BD 100%);
}

.ai-essay-writer-section .btn-generate:active {
  transform: translateY(0);
}

.ai-essay-writer-section .btn-generate svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  margin-left: 2px;
}

.ai-essay-writer-section .btn-generate:hover svg {
  transform: scale(1.15) rotate(12deg);
}

.ai-essay-writer-section .btn-generate:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  box-shadow: none;
}

.ai-essay-writer-section .btn-generate:disabled:hover {
  transform: none;
}

/* Editors Banner */
.ai-essay-writer-section .editors-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  padding: 20px 32px;
  border-radius: 50px;
  max-width: 600px;
  margin: 0 auto;
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.15);
}

.ai-essay-writer-section .editors-text {
  font-size: 15px;
  font-weight: 600;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #075985;
  margin: 0;
  flex: 1;
}

.ai-essay-writer-section .editors-avatars {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.ai-essay-writer-section .editor-avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50%;
  border: 2px solid #ffffff;
  object-fit: cover;
  margin-left: -8px;
  transition: transform 0.2s ease;
  display: block;
}

.ai-essay-writer-section .editor-avatar:first-child {
  margin-left: 0;
}

.ai-essay-writer-section .editor-avatar:hover {
  transform: scale(1.1);
  z-index: 1;
}

/* Result View Styles */
.essay-result-wrapper,
.topic-result-wrapper {
  animation: fadeIn 0.3s ease-in-out;
  min-height: auto;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ai-essay-writer-section .result-header {
  margin-bottom: 16px;
}

.ai-essay-writer-section .btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #14b8a6;
  font-size: 16px;
  font-weight: 600;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: underline;
}

.ai-essay-writer-section .btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #2dd4bf;
}

.ai-essay-writer-section .btn-back svg {
  width: 20px;
  height: 20px;
}

/* Result Content Layout */
.ai-essay-writer-section .result-content {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 32px;
  align-items: start;
}

/* Left Sidebar - Dark Theme */
.ai-essay-writer-section .result-sidebar {
  background: #1a1a2e52;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 24px;
  height: fit-content;
  overflow-y: auto;
}

.result-topic-card,
.result-subject-card {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.ai-essay-writer-section .topic-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  position: relative;
}
.ai-essay-writer-section .topic-header .btn-icon::after {
  content: unset;
}
.ai-essay-writer-section .topic-header h3 {
  font-size: 18px;
  font-weight: 600;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #ffffff;
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

.result-topic-input,
.result-subject-input {
  flex: 1;
  width: 100%;
  min-height: 80px;
  font-size: 18px;
  font-weight: 600;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #ffffff;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  margin: 0;
  line-height: 1.6;
  resize: vertical;
  overflow-y: auto;
  max-height: 200px;
}

.result-topic-input::placeholder,
.result-subject-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.result-topic-input:focus,
.result-subject-input:focus {
  outline: none;
}

.ai-essay-writer-section .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
}

.ai-essay-writer-section .btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.ai-essay-writer-section .btn-clear-topic svg,
.ai-essay-writer-section .btn-clear-subject svg {
  width: 16px;
  height: 16px;
}

.topic-char-count,
.subject-char-count {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Result Settings - Dark Theme */
.ai-essay-writer-section .result-settings {
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
}

.ai-essay-writer-section .setting-item {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.ai-essay-writer-section .setting-item.toggle-setting {
  justify-content: space-between;
  width: 100%;
}

.ai-essay-writer-section .setting-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ai-essay-writer-section .result-select {
  width: 100%;
  padding: 8px 27px 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #ffffff;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='rgba(255,255,255,0.6)' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  outline: none;
}

.ai-essay-writer-section .result-select:hover {
  border-color: rgba(255, 255, 255, 0.25);
}

.ai-essay-writer-section .result-select:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.ai-essay-writer-section .result-select option {
  padding: 8px;
  background: #1a1a2e;
  color: #ffffff;
}

/* Result Actions - Dark Theme */
.ai-essay-writer-section .result-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-essay-writer-section .btn-generate-again {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: #05ada3;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(5, 173, 163, 0.25);
  white-space: nowrap;
}

.ai-essay-writer-section .btn-generate-again:hover {
  background: #14b8a6;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20, 184, 166, 0.35);
}

.ai-essay-writer-section .btn-generate-again svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  margin-left: 2px;
}

.ai-essay-writer-section .btn-generate-again:hover svg {
  transform: scale(1.15) rotate(12deg);
}

.ai-essay-writer-section .btn-clear-settings {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ai-essay-writer-section .btn-clear-settings:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Previous Prompts - Dark Theme */
.ai-essay-writer-section .previous-prompts {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-essay-writer-section .previous-prompts p {
  font-size: 14px;
  font-weight: 600;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #ffffff;
  margin: 0 0 12px 0;
}

.ai-essay-writer-section .prompts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 156px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}

.ai-essay-writer-section .prompts-list::-webkit-scrollbar {
  width: 6px;
}

.ai-essay-writer-section .prompts-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.ai-essay-writer-section .prompts-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.ai-essay-writer-section .prompts-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ai-essay-writer-section .prompts-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.4;
}

.ai-essay-writer-section .prompts-list li:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.ai-essay-writer-section .prompts-list li svg {
  width: 14px;
  height: 14px;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

.ai-essay-writer-section .prompts-list li .prompt-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Result Disclaimer */
.ai-essay-writer-section .result-disclaimer {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
}

.ai-essay-writer-section .result-disclaimer p {
  margin: 0;
}

/* Right Main Panel - Dark Theme */
.ai-essay-writer-section .result-main {
    background: #1a1a2e52;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

/* Loading State - Dark Theme */
.essay-loading,
.topics-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 20px;
}

.ai-essay-writer-section .loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #14b8a6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.essay-loading p,
.topics-loading p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-weight: 500;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ========== ESSAY SPECIFIC STYLES - Dark Theme ========== */
.ai-essay-writer-section .essay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  gap: 32px;
  flex-wrap: nowrap;
}

/* Output Tabs - New Results / Previous Outputs */
.ai-essay-writer-section .output-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-essay-writer-section .output-tab {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ai-essay-writer-section .output-tab:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

.ai-essay-writer-section .output-tab.active {
  color: #05ada3;
  background: rgba(5, 173, 163, 0.1);
}

.ai-essay-writer-section .output-tab.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Previous Outputs Container */
.ai-essay-writer-section .previous-outputs-container {
  padding: 24px;
  min-height: 400px;
  max-height: 638px;
  overflow-y: auto;
}

.ai-essay-writer-section .previous-outputs-container::-webkit-scrollbar {
  width: 6px;
}

.ai-essay-writer-section .previous-outputs-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.ai-essay-writer-section .previous-outputs-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

/* History Item */
.ai-essay-writer-section .history-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.ai-essay-writer-section .history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-essay-writer-section .history-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.ai-essay-writer-section .history-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-essay-writer-section .history-item-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.ai-essay-writer-section .history-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-essay-writer-section .history-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-essay-writer-section .history-action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.ai-essay-writer-section .history-item-content {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  max-height: 150px;
  overflow: hidden;
  position: relative;
}

.ai-essay-writer-section .history-item-content.expanded {
  max-height: none;
}

.ai-essay-writer-section .history-item-content::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, rgba(26, 26, 46, 0.95));
  pointer-events: none;
}

.ai-essay-writer-section .history-item-content.expanded::after {
  display: none;
}

.ai-essay-writer-section .history-expand-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  background: none;
  border: none;
  color: #05ada3;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
}

.ai-essay-writer-section .history-expand-btn:hover {
  color: #14b8a6;
}

/* Empty History State */
.ai-essay-writer-section .history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.ai-essay-writer-section .history-empty svg {
  width: 64px;
  height: 64px;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 16px;
}

.ai-essay-writer-section .history-empty p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* Login Prompt for History */
.ai-essay-writer-section .history-login-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.ai-essay-writer-section .history-login-prompt svg {
  width: 80px;
  height: 80px;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 20px;
}

.ai-essay-writer-section .history-login-prompt p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 16px 0;
}

.ai-essay-writer-section .history-login-btn {
  padding: 10px 24px;
  background: #05ada3;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-essay-writer-section .history-login-btn:hover {
  background: #14b8a6;
}

.ai-essay-writer-section .essay-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ai-essay-writer-section .word-count {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Action item with arrow */
.ai-essay-writer-section .action-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-essay-writer-section .action-item .arrow {
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
}

.ai-essay-writer-section .btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 0;
  white-space: nowrap;
  position: relative;
}

.ai-essay-writer-section .btn-action:hover {
  color: #ffffff;
}

.ai-essay-writer-section .btn-action svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Hide last arrow */
.ai-essay-writer-section .action-item:last-child .arrow {
  display: none;
}

/* Essay Content */
.ai-essay-writer-section .essay-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  position: relative;
    min-height: 638px;
    max-height: 638px;
}

.ai-essay-writer-section .essay-text {
  font-size: 15px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
  word-wrap: break-word;
}

.ai-essay-writer-section .essay-text p {
  margin: 0 0 16px 0;
}

.ai-essay-writer-section .essay-text p:last-child {
  margin-bottom: 0;
}

/* Essay Footer */
.ai-essay-writer-section .essay-footer {
  padding: 24px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-essay-writer-section .editors-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  padding: 20px 28px;
  border-radius: 16px;
}

.ai-essay-writer-section .editors-info {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.ai-essay-writer-section .editors-text-large {
  font-size: 15px;
  font-weight: 600;
  color: #075985;
  margin: 0;
}

.ai-essay-writer-section .btn-polish {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: #233f8c;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'CircularStd', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.25);
  flex-shrink: 0;
  text-decoration: none;
}

.ai-essay-writer-section .btn-polish:hover {
  background: #1f46b4;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(30, 41, 59, 0.35);
}

.ai-essay-writer-section .btn-polish svg {
  width: 20px;
  height: 20px;
}

/* Info Tooltip */
.ai-essay-writer-section .info-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f0f1a;
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 1000;
}

.ai-essay-writer-section .info-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #0f0f1a;
}

.ai-essay-writer-section .btn-icon:hover .info-tooltip {
  opacity: 1;
  visibility: visible;
}

.ai-essay-writer-section .tooltip-item {
  font-size: 13px;
  line-height: 1.6;
  color: #e2e8f0;
}

.ai-essay-writer-section .tooltip-item:not(:last-child) {
  margin-bottom: 4px;
}

.ai-essay-writer-section .tooltip-value {
  font-weight: 600;
  color: #ffffff;
}

/* ========== RESPONSIVE STYLES ========== */
@media (max-width: 1024px) {
  .ai-essay-writer-section .form-row {
    flex-wrap: wrap;
  }

  .ai-essay-writer-section .form-group {
    min-width: calc(50% - 6px);
  }

  .essay-result-wrapper,
  .topic-result-wrapper {
    padding: 20px 15px;
  }

  .ai-essay-writer-section .result-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .ai-essay-writer-section .result-sidebar {
    position: static;
    order: 1;
  }

  .ai-essay-writer-section .result-main {
    order: 2;
  }
}

@media (max-width: 768px) {
  .ai-essay-writer-section,
  .topic-generator-section {
    padding: 0;
  }

  .essay-writer-wrapper,
  .topic-generator-wrapper {
    padding: 0;
  }

  .essay-form-card,
  .topic-form-card {
    padding: 20px;
  }

  .ai-essay-writer-section .form-row {
    flex-direction: column;
  }

  .ai-essay-writer-section .form-group {
    width: 100%;
    min-width: 100%;
  }

  .ai-essay-writer-section .action-row {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .ai-essay-writer-section .toggle-label {
    justify-content: space-between;
  }

  .ai-essay-writer-section .btn-generate {
    width: 100%;
    justify-content: center;
  }

  .ai-essay-writer-section .editors-banner {
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 16px;
    text-align: center;
  }

  .ai-essay-writer-section .editors-text {
    text-align: center;
  }

  .ai-essay-writer-section .editors-avatars {
    justify-content: center;
  }

  .ai-essay-writer-section .trust-badges {
    gap: 20px;
    margin-top: 24px;
  }

  .ai-essay-writer-section .badge-item {
    font-size: 13px;
    gap: 6px;
  }

  .ai-essay-writer-section .badge-item svg {
    width: 16px;
    height: 16px;
  }

  .ai-essay-writer-section .result-sidebar {
    padding: 20px;
  }

  .ai-essay-writer-section .essay-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
  }

  .ai-essay-writer-section .essay-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .ai-essay-writer-section .essay-content {
    padding: 24px 20px;
  }

  .ai-essay-writer-section .essay-footer {
    padding: 20px;
  }

  .ai-essay-writer-section .editors-cta {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
  }

  .ai-essay-writer-section .editors-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .ai-essay-writer-section .btn-polish {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 575px) {
  .ai-essay-writer-section .main-heading {
    font-size: 28px;
  }

  .essay-form-card,
  .topic-form-card {
    padding: 20px;
    border-radius: 12px;
  }

  .essay-topic-input,
  .subject-input {
    min-height: 258px;
    padding: 12px;
    padding-bottom: 48px;
    font-size: 14px;
  }

  .ai-essay-writer-section .textarea-actions {
    flex-direction: column;
    flex-wrap: wrap;
    bottom: 18px;
    left: 12px;
    right: 12px;
    gap: 6px;
  }

  .ai-essay-writer-section .btn-paste,
  .ai-essay-writer-section .btn-history {
    flex: 1;
    min-width: 300px;
    justify-content: center;
  }

  .ai-essay-writer-section .form-select {
    font-size: 13px;
    padding: 10px 36px 10px 12px;
  }

  .ai-essay-writer-section .btn-generate {
    padding: 12px 24px;
    font-size: 14px;
  }

  .ai-essay-writer-section .editors-banner {
    padding: 16px 20px;
  }

  .ai-essay-writer-section .editors-text {
    font-size: 14px;
  }

  .ai-essay-writer-section .editor-avatar {
    width: 36px;
    height: 36px;
  }

  .ai-essay-writer-section .btn-back {
    font-size: 14px;
    padding: 8px 16px;
  }

  .ai-essay-writer-section .character-count {
    bottom: -15px;
    right: 0px;
    font-size: 12px;
  }

  .ai-essay-writer-section .trust-badges {
    gap: 16px;
  }

  .ai-essay-writer-section .badge-item {
    flex: 0 0 calc(50% - 8px);
    justify-content: center;
  }

  .ai-essay-writer-section .essay-header {
    padding: 14px 16px;
  }

  .ai-essay-writer-section .essay-content {
    padding: 20px 16px;
    min-height: unset;
  }

  .ai-essay-writer-section .essay-text {
    font-size: 14px;
  }

  .ai-essay-writer-section .btn-share,
  .ai-essay-writer-section .btn-copy {
    padding: 6px 10px;
    font-size: 13px;
  }

  .ai-essay-writer-section .btn-share span,
  .ai-essay-writer-section .btn-copy span {
    display: none;
  }
}
