@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Roboto+Mono:wght@400;500&display=swap');
@import url('https://use.hugeicons.com/font/icons.css');

/* Hugeicons Utilities */
.hgi {
  font-size: 1.15em;
  vertical-align: -0.15em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.brand-icon .hgi {
  font-size: 1.35rem;
  color: #2b2735;
}

.login-icon .hgi {
  font-size: 1.85rem;
  color: #2b2735;
}

/* Candyland Light Theme (tweakcn.com/editor/theme?theme=candyland) */
:root {
  /* Candyland Signature Light Backgrounds & Text */
  --bg-primary: #fcf8fa;       /* Very soft candy pastel blush background */
  --bg-secondary: #ffffff;     /* Pure clean card background */
  --bg-tertiary: #fceef4;      /* Soft pastel pink / cream secondary */
  --bg-input: #faf5f8;         /* Input / textarea light background */

  --text-main: #333333;        /* Dark slate foreground */
  --text-muted: #6f6f6f;       /* Muted neutral */

  /* Candyland Signature Accents from tweakcn */
  --primary: #fec2cc;          /* Pastel Bubblegum Candy Pink (rgb 254 194 204) */
  --primary-hover: #ff97cb;    /* Vibrant Candy Pink hover */
  --primary-text: #2b2735;      /* Dark text on light pink button */

  --secondary: #87cce8;        /* Cotton Candy Sky Blue (rgb 135 204 232) */
  --secondary-hover: #6bbad9;
  
  --accent: #feff55;           /* Lemon Drop Yellow (rgb 254 255 85) */
  --accent-pink: #ff97cb;
  --accent-green: #2fcd30;     /* Mint candy */

  --success: #2fcd30;
  --warning: #ffce27;
  --danger: #f14444;
  --border: #f0e2ea;           /* Soft pastel border */
  --border-focus: #fec2cc;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 25px -5px rgba(244, 114, 182, 0.12), 0 8px 10px -6px rgba(244, 114, 182, 0.08);
  --shadow-candy: 0 8px 24px -4px rgba(254, 194, 204, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(254, 194, 204, 0.35) 0px, transparent 55%),
    radial-gradient(at 100% 100%, rgba(135, 204, 232, 0.3) 0px, transparent 55%),
    radial-gradient(at 50% 50%, rgba(254, 255, 85, 0.1) 0px, transparent 65%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.navbar {
  background-color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(244, 114, 182, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #2b2735;
  letter-spacing: -0.01em;
}

.brand-icon {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.25rem;
  box-shadow: 0 4px 14px rgba(254, 194, 204, 0.5);
}

.brand-badge {
  font-size: 0.75rem;
  background: linear-gradient(135deg, rgba(254, 194, 204, 0.35), rgba(135, 204, 232, 0.35));
  color: #d8487b;
  border: 1px solid rgba(254, 194, 204, 0.8);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-main);
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-weight: 500;
}

/* Containers */
.container {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

.grid-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.75rem;
}

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

/* Cards */
.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 14px 34px -5px rgba(244, 114, 182, 0.18), 0 0 0 1px rgba(254, 194, 204, 0.4);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.85rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #2b2735;
}

/* Dropzone */
.dropzone {
  border: 2px dashed rgba(254, 194, 204, 0.8);
  border-radius: var(--radius-sm);
  padding: 1.75rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: linear-gradient(180deg, rgba(254, 194, 204, 0.1) 0%, rgba(135, 204, 232, 0.1) 100%);
}

.dropzone:hover, .dropzone.dragover {
  border-color: #ff97cb;
  background: linear-gradient(180deg, rgba(254, 194, 204, 0.25) 0%, rgba(135, 204, 232, 0.2) 100%);
  transform: translateY(-1px);
}

.dropzone-icon {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  color: #e0608e;
}

.dropzone-text {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #2b2735;
}

.dropzone-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Textarea & Controls */
.text-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.text-meta-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meta-tag {
  background: rgba(254, 194, 204, 0.35);
  color: #b8336a;
  border: 1px solid rgba(254, 194, 204, 0.7);
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.editor-textarea {
  width: 100%;
  min-height: 230px;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 1rem 1.15rem;
  font-size: 0.95rem;
  line-height: 1.65;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.editor-textarea:focus {
  background-color: #ffffff;
  border-color: #ff97cb;
  box-shadow: 0 0 0 3px rgba(254, 194, 204, 0.45);
}

/* Controls & Form inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333333;
  display: flex;
  justify-content: space-between;
}

.form-select, .form-input {
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.68rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.form-select:focus, .form-input:focus {
  background-color: #ffffff;
  border-color: #ff97cb;
  box-shadow: 0 0 0 3px rgba(254, 194, 204, 0.45);
}

.slider-container {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.slider-val {
  font-size: 0.82rem;
  color: #0284c7;
  font-weight: 600;
  background: rgba(135, 204, 232, 0.3);
  padding: 0.1rem 0.5rem;
  border-radius: 6px;
}

input[type="range"] {
  accent-color: #f472b6;
  height: 6px;
  border-radius: 999px;
  cursor: pointer;
}

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

.btn-primary {
  background: linear-gradient(135deg, #fec2cc 0%, #ff97cb 50%, #f472b6 100%);
  color: #2b2735;
  box-shadow: 0 6px 18px rgba(254, 194, 204, 0.65);
  font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(254, 194, 204, 0.85);
}

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

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: #333333;
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background-color: #fadce7;
  border-color: rgba(254, 194, 204, 0.8);
  color: #2b2735;
}

.btn-sm {
  padding: 0.38rem 0.85rem;
  font-size: 0.8rem;
  border-radius: 999px;
}

.btn-danger {
  background-color: rgba(241, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(241, 68, 68, 0.3);
}

.btn-danger:hover {
  background-color: #dc2626;
  color: white;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
}

/* Audio Player Card - Candyland Glowing Box */
.player-box {
  background: linear-gradient(145deg, #fff0f5 0%, #ffffff 100%);
  border: 1.5px solid rgba(254, 194, 204, 0.9);
  border-radius: var(--radius);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow-candy);
}

.player-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #2b2735;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

audio {
  width: 100%;
  border-radius: 12px;
}

/* History / Table */
.history-section {
  margin-top: 2.25rem;
}

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th, .table td {
  padding: 0.85rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background-color: #faf3f7;
  color: #6f6f6f;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.table tr:hover td {
  background-color: rgba(254, 194, 204, 0.15);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(43, 39, 53, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--bg-secondary);
  border: 1px solid rgba(254, 194, 204, 0.6);
  border-radius: var(--radius);
  width: 100%;
  max-width: 440px;
  padding: 1.75rem;
  box-shadow: 0 25px 50px -12px rgba(244, 114, 182, 0.3), var(--shadow-candy);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

/* Alerts & Toasts */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 200;
}

.toast {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  box-shadow: 0 10px 25px -5px rgba(244, 114, 182, 0.25);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success { border-color: var(--success); color: #15803d; }
.toast-error { border-color: var(--danger); color: #b91c1c; }
.toast-info { border-color: var(--secondary); color: #0369a1; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(43, 39, 53, 0.3);
  border-radius: 50%;
  border-top-color: #2b2735;
  animation: spin 0.8s linear infinite;
}

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

/* Login Page specific */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at top right, rgba(254, 194, 204, 0.45) 0%, rgba(252, 248, 250, 0.9) 60%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(254, 194, 204, 0.8);
  border-radius: var(--radius);
  padding: 2.5rem 2.25rem;
  box-shadow: 0 25px 50px -12px rgba(244, 114, 182, 0.25), var(--shadow-candy);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.login-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.login-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: 0 10px 24px rgba(254, 194, 204, 0.6);
}

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

.password-input-group input {
  width: 100%;
  padding-right: 2.5rem;
}

.toggle-password {
  position: absolute;
  right: 0.85rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
}
