@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* --- LIGHT MINIMALIST DESIGN SYSTEM --- */
:root {
  /* Default Theme: IA (Purple/Indigo) */
  --primary-h: 260;
  --primary-s: 75%;
  --primary-l: 55%;
  --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-glow: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.08);
  --primary-glow-heavy: hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.18);
  --accent: hsl(var(--primary-h), 80%, 45%);
  --bg-gradient-1: hsl(260, 30%, 97%);
  --bg-gradient-2: hsl(270, 25%, 94%);
  
  /* Shared Colors (Light Theme) */
  --white: #ffffff;
  --text-main: #1e293b;     /* Slate 800 */
  --text-muted: #475569;    /* Slate 600 */
  --text-light: #64748b;    /* Slate 500 */
  
  --card-bg: rgba(255, 255, 255, 0.65);
  --card-border: rgba(255, 255, 255, 0.8);
  --card-border-outer: rgba(15, 23, 42, 0.05);
  --input-bg: rgba(255, 255, 255, 0.85);
  --glass-blur: blur(20px);
  --transition-smooth: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Theme Mappings (Lighter, soft pastels) */
body.theme-esl {
  --primary-h: 150;
  --primary-s: 70%;
  --primary-l: 36%;
  --accent: hsl(155, 80%, 30%);
  --bg-gradient-1: hsl(150, 30%, 97%);
  --bg-gradient-2: hsl(160, 25%, 94%);
}

body.theme-esp32 {
  --primary-h: 24;
  --primary-s: 85%;
  --primary-l: 45%;
  --accent: hsl(28, 85%, 38%);
  --bg-gradient-1: hsl(24, 40%, 97%);
  --bg-gradient-2: hsl(32, 30%, 94%);
}

body.theme-ia {
  --primary-h: 265;
  --primary-s: 75%;
  --primary-l: 54%;
  --accent: hsl(275, 80%, 45%);
  --bg-gradient-1: hsl(265, 30%, 97%) ;
  --bg-gradient-2: hsl(275, 25%, 94%);
}

body.theme-cocina {
  --primary-h: 352;
  --primary-s: 75%;
  --primary-l: 50%;
  --accent: hsl(355, 80%, 42%);
  --bg-gradient-1: hsl(352, 35%, 97%);
  --bg-gradient-2: hsl(5, 25%, 94%);
}

body.theme-diy {
  --primary-h: 200;
  --primary-s: 75%;
  --primary-l: 42%;
  --accent: hsl(195, 85%, 32%);
  --bg-gradient-1: hsl(200, 30%, 97%);
  --bg-gradient-2: hsl(210, 25%, 94%);
}

/* --- BASE & LAYOUT --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-gradient-1);
  background-image: linear-gradient(135deg, var(--bg-gradient-1) 0%, var(--bg-gradient-2) 100%);
  background-attachment: fixed;
  color: var(--text-muted);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Floating Ambient Light Blobs (Fainter and very clean) */
.ambient-glows {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.glow-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.11;
  transition: var(--transition-smooth);
  animation: float-around 25s infinite alternate ease-in-out;
}

.glow-1 {
  width: 50vw;
  height: 50vw;
  background-color: var(--primary);
  top: -15%;
  right: -10%;
}

.glow-2 {
  width: 40vw;
  height: 40vw;
  background-color: var(--accent);
  bottom: -10%;
  left: -5%;
  animation-duration: 30s;
}

/* App Container */
.app-wrapper {
  position: relative;
  z-index: 1;
  max-width: 1320px; /* Sightly narrower for a more elegant grid */
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: 100vh;
}

/* --- BROWSER SHELL / HEADER (Ultra Minimalist) --- */
.browser-shell {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--card-border-outer);
  border-radius: 20px;
  backdrop-filter: var(--glass-blur);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.04);
}

.browser-header {
  background: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.browser-dots {
  display: flex;
  gap: 7px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(15, 23, 42, 0.1); /* Neutral light dots for minimalism */
}

.browser-address-bar {
  flex-grow: 1;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.04);
  border-radius: 10px;
  padding: 0.45rem 1.25rem;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.address-ssl {
  color: #059669; /* Slate green */
  display: flex;
  align-items: center;
}

.address-host {
  color: var(--text-main);
  font-weight: 600;
}

.address-path {
  color: var(--primary);
  font-weight: bold;
}

/* --- TAB NAVIGATION (SUBDOMAINS) --- */
.subdomains-nav {
  display: flex;
  gap: 0.25rem;
  padding: 0.75rem 1.5rem 0 1.5rem;
  background: rgba(255, 255, 255, 0.25);
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  overflow-x: auto;
  scrollbar-width: none;
}

.subdomains-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: none;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--text-light);
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.8rem 1.2rem;
  border-radius: 12px 12px 0 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
  position: relative;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(15, 23, 42, 0.04);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
}

.tab-badge {
  font-family: monospace;
  font-size: 0.72rem;
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-muted);
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: normal;
}

.tab-btn.active .tab-badge {
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: bold;
}

/* --- MAIN DASHBOARD LAYOUT --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 2rem;
  padding: 2rem;
  min-height: 600px;
}

/* --- SIDEBAR: SUGERENCIAS & IDEA GENERATOR --- */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.glass-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.02);
  border-radius: 16px;
  padding: 1.5rem;
  backdrop-filter: var(--glass-blur);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: rgba(15, 23, 42, 0.06);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.04);
}

.panel-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  padding-bottom: 0.6rem;
}

.panel-title svg {
  color: var(--primary);
}

/* Idea Generator Box (Minimalist Clean Light Style) */
.generator-card {
  border: 1px dashed var(--primary);
  background: rgba(255, 255, 255, 0.35);
}

.generator-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1.25rem;
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: var(--transition-smooth);
}

.generator-btn:hover {
  background: var(--accent);
  box-shadow: 0 6px 18px var(--primary-glow-heavy);
}

.generated-idea-box {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.04);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.85rem;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.02);
  animation: fade-slide-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.idea-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.95rem;
}

.idea-desc {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

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

.idea-action-btn {
  flex-grow: 1;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.05);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.4rem;
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.idea-action-btn:hover {
  background: var(--primary-glow);
  color: var(--primary);
  border-color: var(--primary);
}

/* User Suggestions Feed */
.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 230px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.suggestion-item {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(15, 23, 42, 0.03);
  border-radius: 8px;
  padding: 0.75rem;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: var(--transition-smooth);
}

.suggestion-item:hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(15, 23, 42, 0.06);
}

.suggestion-user {
  color: var(--primary);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}

.suggestion-time {
  font-size: 0.68rem;
  color: var(--text-light);
  font-weight: normal;
}

.suggestion-text {
  color: var(--text-muted);
  line-height: 1.4;
}

.suggestion-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.suggest-input {
  background: var(--input-bg);
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.82rem;
  transition: var(--transition-smooth);
}

.suggest-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 8px var(--primary-glow);
}

.suggest-btn {
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(15, 23, 42, 0.06);
  color: var(--text-main);
  border-radius: 8px;
  padding: 0.5rem;
  font-family: var(--font-title);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

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

/* --- MAIN CONTENT WINDOW --- */
.content-window {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: fade-in 0.4s ease-out;
}

.window-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.interest-meta {
  display: flex;
  flex-direction: column;
}

.interest-title {
  font-family: var(--font-title);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.interest-desc {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-top: 0.25rem;
  max-width: 600px;
}

.action-bar {
  display: flex;
  gap: 0.5rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text-main);
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  background: var(--white);
  border-color: rgba(15, 23, 42, 0.15);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.03);
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 10px var(--primary-glow);
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  background: var(--accent);
  box-shadow: 0 6px 15px var(--primary-glow-heavy);
}

/* Content Sections */
.section-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 2px 7px;
  border-radius: 6px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}

/* Grids */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
}

.empty-state {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.4);
  border: 1px dashed rgba(15, 23, 42, 0.06);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.empty-state svg {
  color: var(--text-light);
}

/* --- CARDS & ITEMS (Ultra Clean Minimalist) --- */
.card-item {
  background: var(--card-bg);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.01);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.card-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.03), 0 0 1px var(--primary-glow);
}

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

.card-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.card-item:hover .card-icon {
  background: var(--primary);
  color: var(--white);
}

.card-delete {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  opacity: 0.65;
  transition: var(--transition-smooth);
}

.card-item:hover .card-delete {
  opacity: 0.85;
}

.card-delete:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  opacity: 1 !important;
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.card-tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-title {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: auto;
  border-top: 1px solid rgba(15, 23, 42, 0.03);
  padding-top: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-meta-info {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-light);
}

.card-action-btn {
  font-family: var(--font-title);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  transition: var(--transition-smooth);
  text-decoration: none;
}

.card-item:hover .card-action-btn {
  color: var(--accent);
}

.card-action-btn:hover {
  transform: translateX(2px);
}

/* --- GLOWING GLASS MODAL (Clean Light Style) --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.15);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-window {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  padding: 2rem;
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08), 0 0 1px var(--primary-glow);
  transform: translateY(20px) scale(0.97);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.modal-overlay.active .modal-window {
  transform: translateY(0) scale(1);
}

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

.modal-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
}

.modal-close {
  background: rgba(15, 23, 42, 0.04);
  border: none;
  color: var(--text-light);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label {
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input {
  background: var(--input-bg);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.88rem;
  transition: var(--transition-smooth);
}

.form-input:focus {
  outline: none;
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 8px var(--primary-glow-heavy);
}

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* File Upload Drag-Drop Area */
.file-drop-area {
  border: 1.5px dashed rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 1.25rem;
  text-align: center;
  background: rgba(15, 23, 42, 0.02);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.file-drop-area:hover, .file-drop-area.dragover {
  border-color: var(--primary);
  background: var(--primary-glow);
}

.file-drop-icon {
  font-size: 1.3rem;
  color: var(--primary);
}

.file-drop-text {
  font-size: 0.8rem;
  color: var(--text-light);
}

.file-drop-text span {
  color: var(--primary);
  font-weight: bold;
}

/* Custom Scrollbar for Suggestions */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.05);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-glow-heavy);
}

/* --- ANIMATIONS --- */
@keyframes float-around {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(3vw, -3vw) scale(1.05);
  }
  100% {
    transform: translate(-2vw, 2vw) scale(0.97);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fade-slide-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- RESPONSIVE LAYOUTS --- */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .sidebar-panel {
    order: 2;
  }
}

@media (max-width: 768px) {
  .app-wrapper {
    padding: 1.5rem 1rem;
  }
  
  .browser-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  
  .browser-dots {
    display: none;
  }
  
  .interest-title {
    font-size: 1.8rem;
  }
  
  .action-bar {
    width: 100%;
  }
  
  .action-bar button {
    flex-grow: 1;
    justify-content: center;
  }
}

/* --- VIDEO THUMBNAILS & DOCUMENT COVER BANNERS --- */
.card-thumbnail-wrapper {
  position: relative;
  width: calc(100% + 2.5rem); /* Extend to card padding edges */
  margin-left: -1.25rem;
  margin-top: -1.25rem;
  height: 150px;
  overflow: hidden;
  background-color: #0f172a;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

.card-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.card-item:hover .card-thumbnail-img {
  transform: scale(1.04);
}

/* Play button overlay for videos */
.video-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.card-item:hover .video-play-overlay {
  background: rgba(15, 23, 42, 0.12);
}

.video-play-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  font-size: 1rem;
  padding-left: 2px; /* visual center for play arrow */
  transition: var(--transition-bounce);
}

.card-item:hover .video-play-btn {
  transform: scale(1.1);
  background: var(--accent);
  box-shadow: 0 6px 20px var(--primary-glow-heavy);
}

/* Document Cover Title Banner ("Imagen de Portada de Título") */
.doc-cover-wrapper {
  width: calc(100% + 2.5rem);
  margin-left: -1.25rem;
  margin-top: -1.25rem;
  height: 125px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, hsl(var(--primary-h), 50%, 93%), hsl(var(--primary-h), 40%, 88%));
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
  box-sizing: border-box;
}

.doc-cover-art {
  width: 95%;
  height: 95%;
  background: #ffffff;
  border-radius: 5px 5px 0 0;
  border: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  padding: 0.65rem;
  position: relative;
  box-sizing: border-box;
  transition: var(--transition-bounce);
}

.card-item:hover .doc-cover-art {
  transform: translateY(-3px) rotate(-0.5deg);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.doc-cover-badge {
  align-self: flex-start;
  font-family: var(--font-title);
  font-size: 0.6rem;
  font-weight: 800;
  background: var(--primary);
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.doc-cover-title {
  font-family: var(--font-title);
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: left;
}

/* Page corner folded effect */
.doc-cover-art::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, transparent 50%, rgba(15, 23, 42, 0.12) 50%);
  border-bottom-left-radius: 3px;
  border-top-right-radius: 5px;
}

/* --- PREMIUM NOTE VIEWER MODAL --- */
.viewer-cover-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.02);
}

.viewer-meta-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-light);
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
  padding-bottom: 0.65rem;
}

.viewer-format-badge {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 0.72rem;
  background: var(--primary-glow);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.viewer-text-section {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(15, 23, 42, 0.03);
  border-radius: 10px;
  padding: 1.1rem;
  white-space: pre-line; /* Preserve linebreaks */
}

.viewer-code-block {
  background: #0f172a !important; /* Force deep dark editor background */
  color: #f1f5f9 !important;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  padding: 1.1rem;
  border-radius: 10px;
  overflow-x: auto;
  white-space: pre;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  margin-top: 0.25rem;
}

.viewer-attachment-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.06);
  border: 1px dashed #10b981;
  color: #047857;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
}

/* ==========================================================================
   ADMIN AUTH & CREATOR MODE STYLING
   ========================================================================== */
.admin-auth-container {
  display: flex;
  align-items: center;
}

.admin-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.admin-badge-btn.reader-mode {
  background: rgba(15, 23, 42, 0.03);
  color: var(--gray-600);
  border-color: rgba(15, 23, 42, 0.05);
}

.admin-badge-btn.reader-mode:hover {
  background: rgba(var(--primary-h), var(--primary-s), 50%, 0.08);
  color: hsl(var(--primary-h), var(--primary-s), 45%);
  border-color: rgba(var(--primary-h), var(--primary-s), 50%, 0.15);
}

.admin-badge-btn.creator-mode {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
  animation: glowEmerald 2s infinite alternate;
}

.admin-badge-btn.creator-mode:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.2);
}

.admin-badge-btn.creator-mode:hover span {
  display: none;
}

.admin-badge-btn.creator-mode:hover::after {
  content: "Cerrar Sesión";
}

@keyframes glowEmerald {
  0% { box-shadow: 0 0 4px rgba(16, 185, 129, 0.15); }
  100% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.35); }
}

/* Modificación sutil de los botones bloqueados para Modo Lector */
.btn-locked-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Ajustes responsivos para el botón de login */
@media (max-width: 600px) {
  .browser-header {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .admin-auth-container {
    width: 100%;
    justify-content: flex-end;
  }
}

/* Efecto de sacudida visual al fallar contraseña */
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ==========================================================================
   THEME: BUZÓN & GUESTBOOK ( Teal / Rose soft glow )
   ========================================================================== */
.theme-buzon {
  --primary-h: 330; /* Rose / Soft Magenta */
  --primary-s: 70%;
  --primary: hsl(var(--primary-h), var(--primary-s), 45%);
  --primary-glow: rgba(var(--primary-h), var(--primary-s), 50%, 0.12);
  --accent: #f43f5e;
  --bg-gradient: radial-gradient(circle at 10% 20%, rgba(254, 242, 244, 0.95) 0%, rgba(255, 255, 255, 1) 90%);
}

/* ==========================================================================
   BUZÓN ( GUESTBOOK ) PAGE COMPONENT STYLES
   ========================================================================== */
.buzon-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.buzon-form-card {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.02);
}

.buzon-muro-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.muro-title {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  padding-bottom: 0.5rem;
}

.muro-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.muro-card {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(15, 23, 42, 0.03);
  border-radius: 12px;
  padding: 1.1rem;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.02);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.muro-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 25px rgba(15, 23, 42, 0.05);
}

.muro-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.muro-card-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.muro-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.muro-user-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}

.muro-time {
  font-size: 0.72rem;
  color: var(--gray-400);
}

.muro-card-text {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-main);
  white-space: pre-wrap;
}

.muro-card-delete {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  opacity: 0.65;
  transition: var(--transition-smooth);
}

.muro-card-delete:hover {
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  opacity: 1;
}

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


