@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

body {
  font-family: 'Inter', sans-serif;
  background-color: #f7f9fc;
  color: #333;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1330px;
  margin: 2rem auto;
  padding: 2rem;
  padding-top: 0.25rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 2rem;
  max-width: 500px;
}

input[type="text"],
input[type="password"],
select,
input[type="file"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}

.file-hint {
  display: block;
  margin-top: -10px;
  color: #666;
}

button.btn,
a.btn {
  box-sizing: border-box;   /* ensure padding + width are calculated the same */
  display: inline-flex;     /* align text inside */
  justify-content: center;
  align-items: center;
  height: 35px;                 /* force same height */
  line-height: 1;               /* normalize text height */
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  width: 140px;
  white-space: nowrap;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Búsqueda y botones */
.search-bar form {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-left {
  flex-grow: 1;
}

.search-left input[type="text"] {
  width: 100%;
  max-width: 300px;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
}

/* Separador visual */
.button-divider {
  width: 1px;
  height: 32px;
  background-color: #ccc;
  margin: 0 0.5rem;
}

/* Botones derechos */
.search-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.dashboard-grid {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.dashboard-grid a {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  min-width: 140px;
  text-align: center;
}

/* Add Part (Azul) */
.login-btn,
.add-btn {
  width: 140px;
  background-color: #3b82f6; /* azul vivo */
}
.nav-buttons button:hover,
.login-btn:hover,
.add-btn:hover {
  background-color: #2563eb; /* azul más oscuro */
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

/* Export CSV (Verde) */
.confirm-btn,
.export-btn {
  background-color: #4CAF50;
}
.confirm-btn:hover,
.export-btn:hover {
  background-color: #388E3C; /* verde más oscuro */
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

/* Import CSV (Naranja) */
.import-btn {
  background-color: #ff9800; /* naranja vivo */
  cursor: pointer;
}
.import-btn:hover {
  background-color: #f57c00; /* naranja más oscuro */
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

/* Logout (Rojo) */
.cancel-btn,
.logout-btn {
  background-color: #f44336;
}
.cancel-btn:hover,
.logout-btn:hover {
  background-color: #d32f2f; /* rojo más oscuro */
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

table th,
table td {
  padding: 0.6rem;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

table th {
  background-color: #f0f4f8;
  font-weight: 600;
}

img {
  border-radius: 4px;
  object-fit: cover;
}

th {
  position: relative;
  text-align: left;
  white-space: nowrap;
  padding-right: 1.2em;
}

th.asc::after,
th.desc::after {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8em;
  pointer-events: none;
  color: #888;
}

th.asc::after {
  content: "▲";
}

th.desc::after {
  content: "▼";
}

.login-container, 
.client-container {
  max-width: 400px;
  margin: 5rem auto;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  background: #fff;
}

.login-form input {
  width: 100%;
  padding: 10px;
  margin: 0.5rem 0;
  border-radius: 8px;
  border: 1px solid #ccc;
}

.login-form .btn {
  width: 140px;
  margin-top: 1rem;
}

.error {
  color: red;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
  scroll-margin-top: 90px;
  font-weight: 600;
  border-left: 6px solid #3b82f6;
  padding-left: 10px;
  color: #333;
}

.dashboard-grid {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.card {
  border-radius: 16px;
  color: white;
  padding: 1.5rem;
  width: 240px;
  height: 240px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  transition: background 0.6s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: center;
  position: relative;
  background-size: 300% 300%;
  animation: gradientFlow 8s ease infinite;
}

.card ul {
  width: 100%;
  padding: 0;
  margin: 0;
  list-style: none;
}

.card .list-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 4px 0;
}

.card .list-row .label,
.card .list-row .value {
  font-size: 0.95rem;
  color: white;
}

.card ul li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.card ul li .label {
  font-weight: 600;
  color: white;
}

.card ul li .value {
  font-weight: 500;
  color: white;
}

.card-icon {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}
.card-icon img {
  width: 80px;
  height: 80px;
}

.card-blue {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
}
.card-blue:hover {
  background: linear-gradient(135deg, #2563eb, #6366f1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.card-green {
  background: linear-gradient(135deg, #10b981, #34d399);
}
.card-green:hover {
  background: linear-gradient(135deg, #059669, #22c55e);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.card-yellow {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.card-yellow:hover {
  background: linear-gradient(135deg, #d97706, #facc15);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.big-number {
  font-size: 2rem;
  font-weight: bold;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  max-width: 400px;
  width: 90%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-content textarea {
  width: 100%;
  height: 100px;
  margin-bottom: 10px;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
}

.close {
  float: right;
  font-size: 20px;
  cursor: pointer;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f0f4f8;
    padding: 0 1.5rem;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    height: 64px;
}

.header-left h1 {
    margin: 0;
    font-size: 1.4rem;
    color: #333;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.nav-link,
.nav-link-client {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.username {
    font-weight: 600;
}

.client-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.viewer-image {
  display: flex;
  justify-content: center;
  align-items: center;
}

.viewer-image img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
/*"max-width:90%; */

.image-container {
  text-align: center;
  margin:2rem auto;
}

.image-container img {
  max-width: 100%;
  max-height: 550px;
  border-radius: 8px;
}

.nav-buttons {
  text-align: center;
  margin: 10px;
  gap: 10px;
}

.nav-buttons button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 6px;
  border: none;
  background-color: #3b82f6;
  color: white;
  font-weight: 600;
}

.thumbnail-strip {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.thumbnail {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 4px;
  transition: border 0.2s;
}

.thumbnail.active {
  border-color: #3b82f6;
}

.thumbnail-strip img.thumbnail.active,
.thumbnail-strip img.thumbnail:hover {
  opacity: 1;
  transform: scale(1.05);
}

/* Hide mobile account section by default */
.mobile-account {
  display: none;
}

/* Responsive Mobile Navigation */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: #333;
}

/* Mobile styles */
@media (max-width: 768px) {
  .header-right {
    display: none; /* hide desktop user info */
  }

  .mobile-account {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 0.5rem 1rem;
    text-align: center;
  }

  .mobile-account .logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
  
  .app-header {
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    height: auto;
  }

  .header-left h1 {
    font-size: 1.1rem;
    max-width: 70%;
    word-wrap: break-word;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
  }

  .menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: #333;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.2s ease;
    transform-origin: center;
  }

  /* balanced X transformation */
  .menu-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translateY(10px);
  }

  .menu-toggle.open span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translateY(-10px);
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 59px; /* height of header */
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #f0f4f8;
    border-top: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 0 0 0 8px;
    padding: 0.5rem 0;
    overflow: hidden; /* prevents border bleed */
    box-sizing: border-box;
  }

  .main-nav.open {
    display: flex;
    animation: slideDown 0.3s ease forwards;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-link {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    box-sizing: border-box;
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  :target {
    scroll-margin-top: 1rem;
  }
}
