/* styles.css — Shinka News Platform */

:root {
  /* Color Palette */
  --bg-dark: #0a0a0f;
  --bg-card: #14141d;
  --bg-input: #1a1a27;
  --primary: #5c62ec;
  --primary-hover: #4a50d2;
  --accent: #00d2ff;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --white: #ffffff;
  --whatsapp-green: #25d366;
  --whatsapp-bubble: #1f2c34;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Transitions & Shadows */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
}

#app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--glass-border);
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header__logo {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 700;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(92, 98, 236, 0.3);
}

.header__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header__subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.header__badge {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  padding: 0.5rem 1rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

/* Main Layout */
.main-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2.5rem;
}

/* Base Components */
.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card__title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
}

/* Composer Section */
.editor-wrapper {
  position: relative;
  flex: 1;
}

.input--textarea {
  width: 100%;
  min-height: 400px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  resize: none;
  transition: var(--transition);
}

.input--textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(92, 98, 236, 0.15);
}

.composer__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-count {
  color: var(--text-dim);
  font-size: 0.875rem;
}

.composer__actions {
  display: flex;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn--primary {
  background: var(--primary);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
}

.btn--outline:hover {
  background: var(--glass);
  border-color: var(--text-dim);
  color: var(--text-main);
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  padding: 0.5rem 0.75rem;
}

.btn--ghost:hover {
  background: rgba(0, 210, 255, 0.1);
}

/* Dropdown Menu */
.templates-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  width: 240px;
  z-index: 100;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dropdown-menu--hidden {
  display: none;
}

.dropdown-item {
  padding: 0.75rem 1rem;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  font-size: 0.875rem;
  transition: var(--transition);
}

.dropdown-item:hover {
  background: var(--glass);
}

/* WhatsApp Preview */
.whatsapp-preview {
  background: #0b141a;
  background-image: url('https://user-images.githubusercontent.com/15075759/28719144-86dc0f70-73b1-11e7-911d-60d70fcded21.png');
  background-size: contain;
  border-radius: 16px;
  padding: 2.5rem 1.5rem;
  min-height: 200px;
}

.whatsapp-bubble {
  background: var(--whatsapp-bubble);
  padding: 0.75rem 1rem;
  border-radius: 0 10px 10px 10px;
  position: relative;
  max-width: 85%;
  box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
}

.whatsapp-bubble__sender {
  color: var(--whatsapp-green);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.whatsapp-bubble__text {
  font-size: 0.9375rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.whatsapp-bubble__meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  color: var(--text-dim);
}

.whatsapp-bubble__status {
  color: #53bdeb;
}

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-list__empty {
  text-align: center;
  color: var(--text-dim);
  padding: 2rem;
  border: 1px dashed var(--glass-border);
  border-radius: 12px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
}

.modal-overlay--hidden {
  display: none;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

/* Loader */
.loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  z-index: 2000;
}

.loader--hidden {
  display: none;
}

.loader__spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  #app {
    padding: 1rem;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .composer__actions {
    width: 100%;
  }

  .btn {
    flex: 1;
  }
}