/* ================================
   MODO OSCURO (por defecto)
   ================================ */

/* Box sizing universal */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Layout base - modo oscuro */
.body-layout {
  background-color: #1e1e2f;
  color: white;
  font-family: sans-serif;
  display: flex;
  height: 100vh;
  overflow: hidden;
  margin: 0;
}

/* Responsive layout */
@media (max-width: 768px) {
  .body-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #999;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
  }

  .main-panel {
    padding: 1rem;
  }

  .modal-box {
    margin: 1rem;
  }
}

/* Sidebar */
.sidebar {
  width: 20rem;
  background-color: #2a2549;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #5b21b6;
  overflow-y: auto;
  color: #c4b5fd;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #c4b5fd;
  flex-grow: 1;
}

/* Buttons */
.button,
.button-accent,
.button-danger,
.button-green {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.button:active {
  transform: scale(0.97);
}

.button-accent {
  background-color: #7c3aed;
  color: white;
}

.button-accent:hover {
  background-color: #6b21a8;
}

.button-danger {
  background-color: #7f1d1d;
  color: white;
}

.button-danger:hover {
  background-color: #991b1b;
}

.button-green {
  background-color: #2f5233;
  color: white;
}

.button-green:hover {
  background-color: #3c6e43;
}

.button-accent.small {
  font-size: 0.875rem;
}

/* Search */
.sidebar-search {
  margin-bottom: 1rem;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background-color: #3b3164;
  color: white;
  border: none;
  outline: none;
}

.search-input::placeholder {
  color: #c4b5fd;
}

.search-input:focus {
  box-shadow: 0 0 0 2px #7c3aed;
}

/* Lista */
.entries-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Card de entrada */
.entry-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  background-color: #2a2549;
  border: 1px solid #3b3164;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: white;
}

.entry-card:hover {
  background-color: #3b3164;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Main panel */
.main-panel {
  flex: 1;
  padding: 1.5rem;
  background-color: #1e1e2f;
  overflow-y: auto;
  color: white;
}

/* Detalle */
.entry-detail {
  background-color: rgba(42, 37, 73, 0.6);
  backdrop-filter: blur(8px);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid #6b21a8;
  max-width: 48rem;
  margin: 0 auto;
  transition: all 0.2s ease;
  color: white;
}

/* Placeholder */
.placeholder-text {
  color: #c4b5fd;
  text-align: center;
}

/* Inputs de solo lectura (correo/contraseña) */
.input-copy {
  background-color: #3b3164;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  width: 100%;
  color: white;
  border: none;
  outline: none;
  font-family: monospace;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 1rem;
}

.modal-box {
  background-color: rgba(42, 37, 73, 0.95);
  padding: 1.5rem 2rem;
  border-radius: 1rem;
  color: white;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 30rem;
  text-align: center;
  user-select: none;
}

/* Form inputs */
.form-input {
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background-color: #3b3164;
  color: white;
  border: none;
  outline: none;
  margin-top: 0.75rem;
}

.form-input::placeholder {
  color: #c4b5fd;
}

/* Utilidades */
.text-accent {
  color: #c4b5fd;
}

.text-center {
  text-align: center;
}

.textarea-notes {
  resize: vertical;
  max-height: 300px;
  min-height: 100px;
  overflow-y: auto;
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.5rem;
  background-color: #3b3164;
  color: white;
  border: none;
  outline: none;
  font-family: sans-serif;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.hidden {
  display: none !important;
}

/* Botones dentro del modal centrados y con espacio */
.modal-box > div.buttons {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* ================================
   MODO CLARO (clase .light)
   ================================ */

.body-layout.light {
  background-color: #f9f9f9;
  color: #222;
}

.body-layout.light .sidebar {
  background-color: #eaeaea;
  border-right: 1px solid #ccc;
  color: #333;
}

.body-layout.light .sidebar-title {
  color: #555;
}

.body-layout.light .button-accent {
  background-color: #a37ff9;
  color: white;
}

.body-layout.light .button-accent:hover {
  background-color: #7f57e6;
}

.body-layout.light .button-danger {
  background-color: #ef4444;
  color: white;
}

.body-layout.light .button-danger:hover {
  background-color: #dc2626;
}

.body-layout.light .button-green {
  background-color: #4ade80;
  color: #165f23;
}

.body-layout.light .button-green:hover {
  background-color: #22c55e;
}

.body-layout.light .search-input {
  background-color: #e5e7eb;
  color: #333;
}

.body-layout.light .search-input::placeholder {
  color: #888;
}

.body-layout.light .entry-card {
  background-color: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  color: #222;
}

.body-layout.light .entry-card:hover {
  background-color: #f0f0f0;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.body-layout.light .main-panel {
  background-color: #fff;
  color: #222;
}

.body-layout.light .entry-detail {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  color: #222;
}

.body-layout.light .placeholder-text {
  color: #555;
}

.body-layout.light .input-copy {
  background-color: #f0f0f0;
  color: #222;
  border: 1px solid #ccc;
}

.body-layout.light .modal-box {
  background-color: rgba(255, 255, 255, 0.95);
  color: #222;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.body-layout.light .form-input {
  background-color: #f0f0f0;
  color: #222;
  border: 1px solid #ccc;
}

.body-layout.light .form-input::placeholder {
  color: #888;
}

.body-layout.light .text-accent {
  color: #7c3aed;
}

.body-layout.light .textarea-notes {
  background-color: #f0f0f0;
  color: #222;
  border: 1px solid #ccc;
}
/* ================================
   RESPONSIVE PARA MÓVILES (< 480px)
   ================================ */
@media (max-width: 480px) {
  .body-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    border-right: none;
    border-bottom: 1px solid #444;
  }

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

  .sidebar-title {
    font-size: 1.1rem;
    text-align: left;
    width: 100%;
  }

  .sidebar-search {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .search-input {
    font-size: 1rem;
    padding: 0.5rem;
  }

  .entry-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem;
  }

  .main-panel {
    padding: 1rem;
    font-size: 0.95rem;
  }

  .entry-detail {
    padding: 1rem;
    border-radius: 0.75rem;
    margin: 0.5rem auto;
    width: 100%;
  }

  .modal-box {
    padding: 1rem;
    font-size: 0.95rem;
  }

  .button,
  .button-accent,
  .button-danger,
  .button-green {
    width: 100%;
    padding: 0.6rem;
    font-size: 1rem;
  }

  .modal-box > div.buttons {
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-input,
  .input-copy,
  .textarea-notes {
    font-size: 1rem;
    padding: 0.6rem;
  }

  .textarea-notes {
    min-height: 80px;
  }
}
