/* Premium Glassmorphic Styles for Email Writer Tool */

:root {
  --em-primary: #3b82f6;
  --em-primary-glow: rgba(59, 130, 246, 0.15);
  --em-secondary: #60a5fa;
  --em-gradient: linear-gradient(135deg, #3b82f6, #60a5fa);
  --em-glow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* Tool specific layout updates */
.workspace-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 30px;
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

@media (max-width: 900px) {
  .workspace-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Panel Styles overrides */
.panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 25px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--t);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form inputs customized */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--t2);
}

.input-field {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  color: var(--t);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  outline: none;
}

.input-field:focus {
  outline: none;
  border-color: var(--em-primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

textarea.input-field {
  min-height: 120px;
  resize: vertical;
}


.checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--t2);
}

.checkbox-container input {
  width: 18px;
  height: 18px;
  accent-color: var(--em-primary);
  cursor: pointer;
}

/* Email Subject field container */
.subject-box-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-top: 15px;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subject-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--t2);
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.subject-value {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: inherit;
  color: var(--t);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
}

/* Form actions */
.generate-button {
  background: var(--em-gradient);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--em-glow);
}

.generate-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
  filter: brightness(1.1);
}

.generate-button:active:not(:disabled) {
  transform: translateY(0);
}

.generate-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Tab panel styles */
.tab-container {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--t2);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  color: var(--t);
  background: rgba(255, 255, 255, 0.03);
}

.tab-btn.active {
  color: #fff;
  background: var(--em-gradient);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Variations Cards */
.variation-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.variation-card:hover {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(255, 255, 255, 0.025);
}

.variation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.variation-type {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--em-primary);
  letter-spacing: 0.05em;
}

.variation-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--t2);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.85rem;
}

.action-btn:hover {
  color: var(--t);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.action-btn.star-btn:hover, .action-btn.star-btn.starred {
  color: #ffb703;
  border-color: rgba(255, 183, 3, 0.4);
  background: rgba(255, 183, 3, 0.08);
}

.variation-text {
  font-size: 0.9rem;
  color: var(--t);
  line-height: 1.6;
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

/* Analytics Accordions */
.analytics-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--t2);
  user-select: none;
  transition: all 0.3s;
  margin-top: 15px;
}

.analytics-toggle:hover {
  color: var(--t);
  background: rgba(255, 255, 255, 0.04);
}

.analytics-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.analytics-content {
  padding: 15px 5px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 580px) {
  .analytics-content {
    grid-template-columns: 1fr;
  }
}

.metric-bar {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.metric-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--t2);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  border-radius: 10px;
  width: 0%;
  transition: width 1s ease-out;
}

.fill-high { background: linear-gradient(90deg, #10b981, #34d399); }
.fill-mid { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.fill-low { background: linear-gradient(90deg, #ef4444, #f87171); }

/* Export dropdown */
.export-dropdown {
  position: relative;
  display: inline-block;
}

.export-menu {
  position: absolute;
  right: 0;
  top: 36px;
  background: #111122;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 100;
  display: none;
  min-width: 170px;
  overflow: hidden;
}

.export-dropdown:hover .export-menu {
  display: block;
}

.export-menu a {
  display: block;
  padding: 10px 14px;
  color: var(--t2);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
  text-align: left;
}

.export-menu a:hover {
  background: rgba(255,255,255,0.05);
  color: var(--t);
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--t2);
}

.empty-state i {
  font-size: 2.5rem;
  margin-bottom: 15px;
  opacity: 0.5;
  color: var(--em-primary);
}

.empty-state h3 {
  font-size: 1.05rem;
  color: var(--t);
  margin-bottom: 8px;
  font-weight: 700;
}

.empty-state p {
  font-size: 0.85rem;
  max-width: 280px;
  margin: 0 auto;
  line-height: 1.4;
}

/* Toast alert customized */
.toast-alert {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #111129;
  border: 1.5px solid var(--em-primary);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), var(--em-glow);
  border-radius: 10px;
  padding: 14px 20px;
  color: var(--t);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(.34,1.56,.64,1);
}

.toast-alert.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Info Alert Box */
.info-alert-box {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 8px;
  padding: 12px 15px;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.82rem;
  color: var(--t2);
  line-height: 1.4;
}

.info-alert-box i {
  color: var(--em-primary);
  font-size: 0.95rem;
  margin-top: 2px;
}
