/*
==================================================
TCTC LOCAL KEYWORD BLOG BUILDER: ALCHEMICAL STYLESHEET
==================================================
*/

/* === 1. CORE THEME & CSS VARIABLES === */
:root {
  --bg-primary: #1a0a0a;       /* Darkest Maroon (Forge) */
  --bg-secondary: #0f0606;     /* Near Black (for boxes) */
  --text-primary: #F0F0F0;     /* Parchment White */
  --text-secondary: #C0C0C0;   /* Ash Grey */
  --text-accent: #D4AF37;      /* Bright Gold */
  --border-color: #3D1111;     /* Dark Maroon */
}

/* === 2. BASE STYLES & LAYOUT RESET === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Lato', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.02) 0%, transparent 50%);
}

/* === 3. TEXT SHIMMER & ANIMATIONS === */
@keyframes textShimmer {
  0%   { background-position: -200% center; }
  50%  { background-position: 200% center; }
  100% { background-position: -200% center; }
}

h1, h2, h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  color: var(--text-accent);
  margin-bottom: 1rem;
  background: linear-gradient(
    to right,
    var(--text-accent) 20%,
    #FFFFFF 50%, 
    var(--text-accent) 80%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 5s ease-in-out infinite;
}

@keyframes pulseGlowButton {
  0% {
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
  }
  60% {
    box-shadow: 0 0 22px rgba(212, 175, 55, 0.9);
  }
  100% {
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
  }
}

@keyframes fibonacci-shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 150%;
  }
}

/* === 4. GLASS PANEL EFFECTS === */
.glass-panel {
  background: rgba(15, 6, 6, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.35),
    inset 0 0 30px rgba(212, 175, 55, 0.08);
  border-radius: 16px;
}

/* === 5. INPUT & FORM STYLING === */
.input, select, textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: 'Lato', sans-serif;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--text-accent);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.35), inset 0 0 14px rgba(212, 175, 55, 0.18);
  background: rgba(40, 25, 5, 0.6);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23D4AF37' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding: 0.75rem 3rem 0.75rem 1rem;
  line-height: 1.5;
  height: auto;
  min-height: 2.75rem;
}

select option {
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  line-height: 1.5;
}

/* === 6. BUTTON STYLING === */
button, .btn {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

button:disabled, .btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Primary Button (Generate) */
.btn-primary, button[id*="generate"], button[id*="Generate"] {
  background: var(--text-accent);
  color: var(--bg-secondary);
  border: 2px solid var(--text-accent);
  animation: pulseGlowButton 3s ease-in-out infinite;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 75%;
  height: 100%;
  background: linear-gradient(
    90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.4) 50%, 
    transparent 100%
  );
  z-index: 2;
  transform: skewX(-25deg);
  animation: fibonacci-shimmer 1.618s ease-in-out 0.8s infinite;
}

.btn-primary:hover:not(:disabled) {
  background: transparent;
  color: var(--text-accent);
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.6);
}

/* Secondary Buttons */
.btn-secondary, button[id*="download"], button[id*="export"], button[id*="copy"] {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--text-accent);
  color: var(--text-accent);
  font-size: 0.9rem;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--text-accent);
  color: var(--bg-secondary);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

/* === 7. POST CARD STYLING === */
.post-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--text-accent);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.post-card:hover {
  border-color: var(--text-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.25);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.post-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-accent);
  font-family: 'Cormorant Garamond', serif;
  background: linear-gradient(
    to right,
    var(--text-accent) 20%,
    #FFFFFF 50%, 
    var(--text-accent) 80%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textShimmer 5s ease-in-out infinite;
}

.post-content {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.7;
  padding-right: 0.5rem;
}

.post-content::-webkit-scrollbar {
  width: 6px;
}

.post-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.post-content::-webkit-scrollbar-thumb {
  background: var(--text-accent);
  border-radius: 3px;
}

.copy-btn {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'Lato', sans-serif;
  transition: color 0.3s ease;
}

.copy-btn:hover {
  color: var(--text-accent);
}

/* === 8. RESULTS CONTAINER === */
#resultsContainer {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color) !important;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.35);
}

#resultsContainer:empty::before {
  content: '✧ Generated posts will appear here ✧';
  display: block;
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 2rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
}

/* === 9. STATUS & MESSAGES === */
#status {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-style: italic;
}

#status.success {
  color: #5cd69f;
}

#status.error {
  color: #ff7a7a;
}

/* === 10. RESPONSIVE DESIGN === */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  .btn-primary {
    font-size: 1rem;
  }
}
