/* AI Content Writer - ProofTamil.com */
/* Distinctive design with Tamil cultural elements */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  /* ProofTamil Brand Colors */
  --primary: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-dark: #1e40af;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  
  /* Neutrals */
  --bg-main: #fafbfc;
  --bg-card: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  
  /* Tamil-inspired accent colors */
  --tamil-saffron: #ff9933;
  --tamil-green: #138808;
  --tamil-red: #d94f3d;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(30, 58, 138, 0.08);
  --shadow-lg: 0 8px 24px rgba(30, 58, 138, 0.12);
  --shadow-xl: 0 16px 48px rgba(30, 58, 138, 0.15);
}

.ai-content-writer {
  min-height: 100vh;
  background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 50%, #fef3c7 100%);
  padding: 40px 20px;
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
}

/* Decorative background pattern */
.ai-content-writer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(30, 58, 138, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.writer-container {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Header */
.writer-header {
  text-align: center;
  margin-bottom: 50px;
  animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: bounce 2s infinite;
  display: inline-block;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.header-title {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 15px 0;
  letter-spacing: -0.5px;
}

.header-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 500;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 30px;
  background: var(--bg-card);
  padding: 8px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.6s ease-out 0.2s both;
}

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

.tab {
  flex: 1;
  padding: 16px 24px;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab:hover {
  background: var(--bg-main);
  color: var(--primary);
}

.tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

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

/* Form Section */
.form-section {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  animation: slideInUp 0.6s ease-out 0.3s both;
  border: 1px solid rgba(30, 58, 138, 0.08);
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-group {
  margin-bottom: 28px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-size: 15px;
}

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

.form-textarea {
  width: 100%;
  padding: 18px 20px;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  transition: all 0.3s ease;
  background: var(--bg-main);
}

.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.08);
  background: white;
}

.form-select {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  background: var(--bg-main);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.08);
  background: white;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 28px;
}

/* Checkboxes */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
  padding: 20px;
  background: var(--bg-main);
  border-radius: 12px;
  border: 2px dashed var(--border);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.checkbox-label:hover {
  color: var(--primary);
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* Buttons */
.btn {
  padding: 18px 36px;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-generate {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  box-shadow: var(--shadow-md);
  font-size: 18px;
  padding: 20px;
}

.btn-generate:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
}

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

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

.btn-icon {
  font-size: 22px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Alerts */
.alert {
  padding: 18px 24px;
  border-radius: 12px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 2px solid #fecaca;
}

.alert-icon {
  font-size: 24px;
}

/* Result Section */
.result-section {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 40px;
  margin-top: 32px;
  box-shadow: var(--shadow-lg);
  animation: fadeInScale 0.5s ease-out;
  border: 2px solid rgba(245, 158, 11, 0.2);
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.result-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.result-actions {
  display: flex;
  gap: 12px;
}

.btn-icon-small {
  width: 44px;
  height: 44px;
  border: none;
  background: var(--bg-main);
  border-radius: 12px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid var(--border);
}

.btn-icon-small:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
  border-color: var(--primary);
}

/* Content Blocks */
.content-block {
  margin-bottom: 32px;
}

.content-block-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 16px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-block-title::before {
  content: '▸';
  color: var(--accent);
}

.content-block-text {
  padding: 24px;
  background: var(--bg-main);
  border-radius: 14px;
  line-height: 1.8;
  color: var(--text-primary);
  font-size: 15px;
  border-left: 4px solid var(--accent);
}

.title-text {
  font-size: 24px;
  font-weight: 700;
  font-family: 'Playfair Display', serif;
  color: var(--primary);
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.05) 0%, rgba(245, 158, 11, 0.05) 100%);
}

.main-content p {
  margin: 0 0 16px 0;
}

.main-content p:last-child {
  margin-bottom: 0;
}

/* Keywords */
.keywords-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.keyword-tag {
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  color: white;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Metadata */
.metadata {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.03) 0%, rgba(245, 158, 11, 0.03) 100%);
  border-radius: 12px;
  margin-top: 32px;
}

.metadata-item {
  text-align: center;
}

.metadata-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metadata-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

/* ==========================
   Publish tools (Blog + Social)
   ========================== */
.publish-tools {
  margin-top: 22px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}
.publish-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 1024px) {
  .publish-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.publish-card {
  background: var(--bg-main);
  border-radius: 18px;
  border: 2px solid rgba(30, 58, 138, 0.08);
  padding: 18px;
}
.publish-card-header {
  margin-bottom: 10px;
}
.publish-card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin: 0;
}
.publish-card-subtitle {
  margin: 6px 0 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}
.publish-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 12px;
}
.publish-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}
.form-input {
  width: 100%;
  border-radius: 12px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--text-primary);
  font-size: 14px;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.18);
}
.publish-actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}
.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 2px solid rgba(30, 58, 138, 0.25);
}
.btn-secondary:hover {
  background: rgba(30, 58, 138, 0.06);
}
.publish-status {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 13px;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--text-primary);
}
.publish-status.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}
.publish-status.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.preview-block {
  margin-top: 14px;
  border-radius: 16px;
  border: 2px solid var(--border);
  background: #fff;
  overflow: hidden;
}
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  background: var(--bg-main);
}
.preview-title {
  font-weight: 800;
  font-size: 13px;
  color: var(--text-primary);
}
.preview-meta {
  font-size: 12px;
  color: var(--text-secondary);
}
.blog-preview {
  padding: 14px;
  color: var(--text-primary);
}
.blog-preview .prooftamil-blog header .kicker {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.blog-preview .prooftamil-blog header h1 {
  font-size: 22px;
  margin: 8px 0 0 0;
}
.blog-preview .prooftamil-blog header .subhead {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.blog-preview .prooftamil-blog header .excerpt {
  margin-top: 10px;
  color: var(--text-primary);
  line-height: 1.7;
}
.blog-preview .prooftamil-blog .content p {
  margin: 0 0 12px 0;
  line-height: 1.75;
}
.social-block {
  margin-top: 14px;
}
.social-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.social-title {
  font-weight: 800;
  font-size: 13px;
  color: var(--text-primary);
}

/* Info Footer */
.info-footer {
  text-align: center;
  padding: 32px 24px;
  margin-top: 40px;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.05) 0%, rgba(245, 158, 11, 0.05) 100%);
  border-radius: 16px;
  border: 2px dashed var(--border);
}

.info-footer p {
  margin: 0 0 8px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.info-footer p:last-child {
  margin-bottom: 0;
}

.info-note {
  font-size: 13px;
  font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
  .writer-container {
    padding: 0;
  }

  .header-title {
    font-size: 36px;
  }

  .header-subtitle {
    font-size: 16px;
  }

  .form-section {
    padding: 24px;
    border-radius: 20px;
  }

  .result-section {
    padding: 24px;
    border-radius: 20px;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

  .tab {
    padding: 14px 20px;
  }

  .metadata {
    grid-template-columns: repeat(2, 1fr);
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .result-title {
    font-size: 24px;
  }
}

/* Tamil Font Support */
@font-face {
  font-family: 'Tamil';
  src: local('Latha'), local('Tamil MN'), local('Noto Sans Tamil');
}

.tamil-text {
  font-family: 'Tamil', 'Lohit Tamil', sans-serif;
  line-height: 1.9;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection */
::selection {
  background: var(--primary-light);
  color: white;
}
