/* ================================================
   ADMIN STYLES - Based on design-admin.json
   Dark theme with teal accents
   ================================================ */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  background: linear-gradient(to bottom right, #020617, #0f172a, #020617);
  color: #e2e8f0;
  min-height: 100vh;
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  border-radius: 1.5rem;
  border: 1px solid rgba(71, 85, 105, 0.5);
  padding: 2.5rem;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-top: 1rem;
}

.login-header p {
  color: #94a3b8;
  font-size: 0.9rem;
}

.logo-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(to bottom right, #2dd4bf, #0d9488);
  border-radius: 1rem;
  color: white;
  font-weight: 900;
  font-size: 1.5rem;
  box-shadow: 0 10px 40px rgba(20, 184, 166, 0.3);
}

.login-form .form-group {
  margin-bottom: 1.5rem;
}

.login-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

.password-input {
  position: relative;
}

.password-input input {
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 0.75rem;
  color: white;
  font-size: 1rem;
  outline: none;
  transition: all 0.2s;
}

.password-input input::placeholder {
  color: #64748b;
}

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

.toggle-password {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0.25rem;
}

.toggle-password:hover {
  color: #94a3b8;
}

/* Alerts */
.alert {
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert-error {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* Admin Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(12px);
  border-right: 1px solid rgba(51, 65, 85, 0.5);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.sidebar-header .logo-box {
  width: 40px;
  height: 40px;
  font-size: 1.125rem;
}

.logo-text {
  font-weight: 700;
  font-size: 1.125rem;
  color: white;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  color: #94a3b8;
  text-decoration: none;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(51, 65, 85, 0.5);
  color: white;
}

.nav-item.active {
  background: linear-gradient(to right, rgba(20, 184, 166, 0.2), rgba(20, 184, 166, 0.1));
  color: #5eead4;
  border: 1px solid rgba(20, 184, 166, 0.2);
}

.nav-item svg {
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
}

.nav-item.logout {
  color: #f87171;
}

.nav-item.logout:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  min-height: 100vh;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

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

.page-title h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: rgba(51, 65, 85, 0.5);
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
}

.badge-count {
  background: rgba(20, 184, 166, 0.2);
  color: #5eead4;
}

.badge-contact {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(to right, #14b8a6, #06b6d4);
  color: white;
  box-shadow: 0 4px 20px rgba(20, 184, 166, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(to right, #0d9488, #0891b2);
  box-shadow: 0 6px 30px rgba(20, 184, 166, 0.4);
}

.btn-secondary {
  background: rgba(51, 65, 85, 0.5);
  color: #e2e8f0;
  border: 1px solid rgba(71, 85, 105, 0.5);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.8);
  color: white;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.8rem;
}

.btn-full {
  width: 100%;
}

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

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
}

.required {
  color: #f87171;
}

.optional {
  color: #64748b;
  font-weight: 400;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 0.75rem;
  color: white;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

input::placeholder,
textarea::placeholder {
  color: #64748b;
}

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

select {
  cursor: pointer;
}

select option {
  background: #1e293b;
  color: white;
}

textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.form-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.5rem;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
}

/* Filters bar */
.filters-bar {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(71, 85, 105, 0.5);
}

.filters-form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 180px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #94a3b8;
}

.filter-group select {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

/* Cards */
.testimonial-card,
.campaign-card,
.type-card,
.template-card {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(71, 85, 105, 0.5);
  transition: all 0.2s;
}

.testimonial-card:hover,
.campaign-card:hover,
.type-card:hover,
.template-card:hover {
  border-color: rgba(20, 184, 166, 0.3);
}

/* Testimonial card */
.testimonial-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.testimonial-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.testimonial-info strong {
  color: white;
  font-size: 1rem;
}

.testimonial-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #5eead4;
}

.testimonial-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.testimonial-learned,
.testimonial-text {
  margin-bottom: 1rem;
}

.testimonial-learned strong,
.testimonial-text strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.375rem;
}

.testimonial-learned p,
.testimonial-text p {
  color: #cbd5e1;
  font-size: 0.9rem;
  line-height: 1.6;
}

.testimonial-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
}

.toggle-publish {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: #94a3b8;
}

.toggle-publish input {
  width: 18px;
  height: 18px;
  accent-color: #14b8a6;
}

/* Campaign card */
.campaign-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.campaign-header strong {
  color: white;
}

.campaign-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.campaign-link {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.campaign-link input {
  flex: 1;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
}

.campaign-actions {
  display: flex;
  gap: 0.5rem;
}

/* Type card */
.type-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.type-info strong {
  color: white;
}

.type-actions {
  display: flex;
  gap: 0.5rem;
}

/* Template card */
.template-header {
  margin-bottom: 0.5rem;
}

.template-header strong {
  color: white;
  font-size: 1rem;
}

.template-subject {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.template-subject .label {
  color: #64748b;
}

.template-actions {
  display: flex;
  gap: 0.5rem;
}

/* Info box */
.info-box {
  background: rgba(20, 184, 166, 0.1);
  border: 1px solid rgba(20, 184, 166, 0.2);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.info-box h3 {
  color: #5eead4;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.info-box p {
  color: #94a3b8;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.variables-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.variables-list code {
  background: rgba(15, 23, 42, 0.5);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  color: #5eead4;
}

/* Send page */
.send-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.send-form-section {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(71, 85, 105, 0.5);
}

.send-preview-section {
  background: rgba(30, 41, 59, 0.5);
  backdrop-filter: blur(12px);
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid rgba(71, 85, 105, 0.5);
}

.send-preview-section h3 {
  color: white;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.preview-subject {
  background: rgba(15, 23, 42, 0.5);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.preview-container {
  background: white;
  border-radius: 0.5rem;
  height: 500px;
  overflow: hidden;
}

.variables-preview {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
}

.variables-preview h3 {
  color: white;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.variables-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.variable-item {
  background: rgba(15, 23, 42, 0.5);
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.variable-item-full {
  grid-column: span 2;
}

.variable-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.variable-value {
  color: #e2e8f0;
  font-size: 0.85rem;
  word-break: break-all;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #64748b;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: linear-gradient(to bottom right, #1e293b, #0f172a);
  border-radius: 1.5rem;
  border: 1px solid rgba(71, 85, 105, 0.5);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-small {
  max-width: 400px;
}

.modal-large {
  max-width: 800px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.modal-header h2 {
  color: white;
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
}

.modal-close:hover {
  color: white;
}

.modal-body {
  padding: 1.5rem;
}

.modal-success .success-icon {
  width: 80px;
  height: 80px;
  background: rgba(20, 184, 166, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: #14b8a6;
}

.modal-success p {
  text-align: center;
  color: #94a3b8;
  margin-bottom: 1rem;
}

.link-box {
  display: flex;
  gap: 0.5rem;
}

.link-box input {
  flex: 1;
}

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

  .preview-container {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .filters-form {
    flex-direction: column;
  }

  .filter-group {
    min-width: 100%;
  }
}

/* Settings Page */
.settings-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .settings-container {
    grid-template-columns: 1fr;
  }
}

.settings-form {
  background: #1e293b;
  border-radius: 1rem;
  padding: 2rem;
}

.settings-section {
  margin-bottom: 2rem;
}

.settings-section h2 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  color: #f1f5f9;
  margin-bottom: 0.5rem;
}

.settings-section h2 svg {
  color: #14b8a6;
}

.section-hint {
  color: #64748b;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.settings-form .form-group {
  margin-bottom: 1.25rem;
}

.settings-form label {
  display: block;
  color: #e2e8f0;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.settings-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 0.5rem;
  color: #f1f5f9;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.settings-form input:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.settings-form input::placeholder {
  color: #475569;
}

.settings-form .form-hint {
  display: block;
  color: #64748b;
  font-size: 0.8rem;
  margin-top: 0.375rem;
}

.settings-form .password-input {
  position: relative;
  display: flex;
  align-items: center;
}

.settings-form .password-input input {
  padding-right: 3rem;
}

.settings-form .toggle-password {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-form .toggle-password:hover {
  color: #14b8a6;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #334155;
}

.settings-info {
  background: #1e293b;
  border-radius: 1rem;
  padding: 1.5rem;
}

.settings-info h3 {
  font-size: 1rem;
  color: #f1f5f9;
  margin-bottom: 1rem;
}

.settings-info ol {
  padding-left: 1.25rem;
  margin: 0;
}

.settings-info li {
  color: #94a3b8;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.settings-info a {
  color: #14b8a6;
  text-decoration: none;
}

.settings-info a:hover {
  text-decoration: underline;
}

.settings-info .info-note {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #334155;
  font-size: 0.8rem;
  color: #64748b;
}
