:root {
  --bg-color: #121212;
  --card-bg: #1e1e1e;
  --text-color: #e0e0e0;
  --accent-color: #bb86fc;
  --secondary-accent: #03dac6;
  --danger: #cf6679;
  --form-bg: #2d2d2d;
  --input-bg: #333333;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: 'Montserrat', 'Roboto', sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

.container {
  width: 95%;
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem 0;
}

@media (max-width: 1600px) {
  .container {
    max-width: 1600px;
  }
}

@media (max-width: 992px) {
  .container {
    width: 90%;
  }
}

@media (max-width: 768px) {
  .container {
    width: 95%;
    padding: 1rem 0;
  }
}

header {
  background-color: rgba(0, 0, 0, 0.5);
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  animation: slideInDown 0.5s ease forwards;
}

.logo-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.logo-container img {
  max-height: 80px;
  object-fit: contain;
  transition: all 0.3s ease;
}

.logo-container img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 8px rgba(187, 134, 252, 0.6));
}

h1, h2, h3, h4 {
  color: var(--accent-color);
  margin-bottom: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  font-size: 2.5rem;
  text-align: center;
  margin: 2rem 0;
  text-shadow: 0 0 10px rgba(187, 134, 252, 0.5);
}

.card {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Form Styles - Enhanced with two columns */
form {
  background-color: var(--form-bg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.form-title {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  color: var(--secondary-accent);
}

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

.form-group {
  margin-bottom: 1.5rem;
  transition: transform 0.3s;
}

.form-group:hover {
  transform: translateY(-3px);
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

input[type="text"], 
input[type="email"], 
input[type="password"],
select, 
textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid #444;
  border-radius: 8px;
  background-color: var(--input-bg);
  color: var(--text-color);
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

input:focus, 
select:focus, 
textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.2);
  outline: none;
  transform: translateY(-2px);
}

input::placeholder, 
textarea::placeholder {
  color: rgba(224, 224, 224, 0.5);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.submit-container {
  text-align: center;
  margin-top: 1.5rem;
  grid-column: 1 / -1;
}

input[type="submit"], 
.btn {
  background: linear-gradient(45deg, var(--accent-color), #9356cf);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.3s;
  display: inline-block;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(147, 86, 207, 0.3);
}

input[type="submit"]:hover, 
.btn:hover {
  background: linear-gradient(45deg, #9356cf, var(--accent-color));
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(187, 134, 252, 0.4);
}

input[type="submit"]:active, 
.btn:active {
  transform: scale(0.95);
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background-color: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
}

th {
  background-color: var(--accent-color);
  color: black;
  text-align: left;
  padding: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #333;
}

tr:hover {
  background-color: rgba(187, 134, 252, 0.1);
}

.logout-link {
  color: var(--danger);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 2px solid var(--danger);
  border-radius: 4px;
}

.logout-link:hover {
  color: #ff8a9a;
  background-color: rgba(207, 102, 121, 0.1);
}

/* Thank you page */
.thanks-message {
  text-align: center;
  padding: 3rem;
}

.thanks-message h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--secondary-accent);
}

/* Background elements */
.bg-pattern {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle at 10% 20%, rgba(187, 134, 252, 0.03) 0%, transparent 20%),
                    radial-gradient(circle at 80% 50%, rgba(3, 218, 198, 0.03) 0%, transparent 25%),
                    radial-gradient(circle at 40% 80%, rgba(187, 134, 252, 0.03) 0%, transparent 30%);
  z-index: -1;
}

/* Enhanced visual elements */
.section-divider {
  border-top: 1px solid rgba(187, 134, 252, 0.3);
  margin: 2rem 0;
  position: relative;
}

.section-divider::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 4px;
  background: linear-gradient(to right, var(--accent-color), var(--secondary-accent));
  top: -2px;
  left: calc(50% - 25px);
  border-radius: 2px;
}

/* Responsive design - Enhanced */
@media (max-width: 768px) {
  .container {
    width: 95%;
    padding: 1rem;
  }
  
  .logo-container {
    flex-direction: column;
  }
  
  .logo-container img {
    margin-bottom: 1rem;
    max-width: 180px;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .card {
    padding: 1.5rem;
    border-radius: 8px;
  }
  
  /* Switch to single column on mobile */
  .form-row {
    grid-template-columns: 1fr;
    grid-gap: 0;
  }
  
  .form-group {
    margin-bottom: 1.2rem;
  }

  input[type="text"], 
  input[type="email"], 
  input[type="password"],
  select, 
  textarea {
    padding: 0.7rem;
    font-size: 0.95rem;
  }

  input[type="submit"], 
  .btn {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    width: 100%;
  }
  
  table {
    font-size: 0.9rem;
  }
  
  th, td {
    padding: 0.5rem;
  }
}

/* ======= ANIMATIONS ======= */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    transform: translateX(-30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

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

/* Animation utility classes */
.anim-fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.anim-slide-up {
  animation: slideInUp 0.8s ease forwards;
}

.anim-slide-left {
  animation: slideInLeft 0.8s ease forwards;
}

.anim-slide-right {
  animation: slideInRight 0.8s ease forwards;
}

.anim-pulse {
  animation: pulse 1.5s infinite;
}

.anim-delay-1 { animation-delay: 0.1s; }
.anim-delay-2 { animation-delay: 0.2s; }
.anim-delay-3 { animation-delay: 0.3s; }
.anim-delay-4 { animation-delay: 0.4s; }
.anim-delay-5 { animation-delay: 0.5s; }

/* Add smooth transitions to all elements */
* {
  transition: all 0.3s ease;
}

@keyframes slideInDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Specific animations for dashboard */
.dashboard-header {
  animation: fadeIn 0.8s ease forwards;
}

.filter-container {
  animation: slideInUp 0.5s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
  animation-fill-mode: forwards;
}

.dashboard-card {
  animation: fadeIn 0.8s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
  animation-fill-mode: forwards;
  padding: 1.5rem;
}

/* Search and filter styles for dashboard */
.search-filter-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 1.5rem;
  margin-bottom: 2rem;
  background-color: var(--form-bg);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

.search-box {
  position: relative;
}

.search-box input {
  padding-left: 40px;
  width: 100%;
}

.search-box:before {
  content: '🔍';
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.7;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-group select {
  flex: 1;
  min-width: 120px;
}

.filter-label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-color);
  font-weight: 500;
}

.reset-filters {
  background-color: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 8px 15px;
  border-radius: 20px;
  cursor: pointer;
  margin-left: 10px;
  transition: all 0.3s;
}

.reset-filters:hover {
  background-color: var(--danger);
  color: white;
}

/* Table row appearance animation */
tr.show-row {
  animation: fadeIn 0.4s ease forwards;
}

tr.hide-row {
  display: none;
}

.no-results {
  text-align: center;
  padding: 2rem;
  color: var(--danger);
  font-weight: 500;
  grid-column: 1 / -1;
}

/* Loading spinner for filtering operations */
.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(187, 134, 252, 0.3);
  border-radius: 50%;
  border-top-color: var(--accent-color);
  animation: rotate 1s linear infinite;
  margin: 0 auto;
  display: none;
}

.loading .loading-spinner {
  display: block;
}

/* Details toggle animation */
.detail-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.details-open .detail-content {
  max-height: 1000px;
}

.detail-toggle {
  transition: transform 0.3s ease;
}

.details-open .detail-toggle {
  transform: rotate(180deg);
}

/* Improve table scrolling on mobile */
@media (max-width: 768px) {
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background:
      linear-gradient(to right, var(--card-bg) 30%, rgba(255, 255, 255, 0)),
      linear-gradient(to left, var(--card-bg) 30%, rgba(255, 255, 255, 0)) right,
      linear-gradient(to right, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0)) 0 0,
      linear-gradient(to left, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0)) right;
    background-repeat: no-repeat;
    background-size: 20px 100%, 20px 100%, 10px 100%, 10px 100%;
    background-attachment: local, local, scroll, scroll;
  }
}

/* Enhanced responsive table styles - Updated for mobile optimization */
.table-container {
  overflow-x: auto;
  position: relative;
  margin: 1rem 0;
  border-radius: 8px;
  background-color: var(--card-bg);
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

th, td {
  padding: 1rem;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Priority columns that shouldn't shrink too much */
.col-id {
  width: 60px;
  min-width: 60px;
}

.col-name {
  min-width: 180px;
}

.col-email {
  min-width: 180px;
}

.col-instrumento {
  min-width: 120px;
}

.col-vocal, .col-lider {
  min-width: 90px;
}

.col-nivel {
  min-width: 100px;
}

.col-fecha {
  min-width: 110px;
  white-space: nowrap;
}

.col-actions {
  min-width: 100px;
  text-align: center;
}

/* Improved Details row styling */
.detail-content {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.4s ease;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-gap: 1.2rem;
  padding: 1.5rem;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.3));
  border-radius: 8px;
  margin: 0.5rem 1rem 1rem 1rem;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.2);
}

.detail-item {
  padding: 0.8rem;
  background-color: rgba(30, 30, 30, 0.5);
  border-radius: 6px;
  border-left: 3px solid var(--accent-color);
  transition: transform 0.3s ease;
}

.detail-item:hover {
  transform: translateY(-3px);
  background-color: rgba(40, 40, 40, 0.6);
}

.detail-item strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent-color);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-item span {
  display: block;
  line-height: 1.5;
  color: var(--text-color);
}

.detail-item.full-width {
  grid-column: 1 / -1;
}

/* Add a specific style for longer text fields */
.detail-text-large {
  white-space: pre-line;
  line-height: 1.6;
  padding: 0.5rem;
  max-height: 150px;
  overflow-y: auto;
  border-radius: 4px;
  background-color: rgba(0,0,0,0.2);
  font-style: italic;
}

/* Scroll indicator for mobile */
.scroll-indicator {
  display: none;
  text-align: center;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent-color);
  font-size: 0.9rem;
  animation: fadeInOut 2s ease infinite;
}

/* Better responsive behavior for mobile table */
@media (max-width: 768px) {
  /* Show only most important columns on mobile */
  .col-id, .col-name, .col-instrumento, .col-actions {
    display: table-cell;
  }

  .col-email, .col-vocal, .col-lider, .col-nivel, .col-fecha {
    display: none;
  }

  /* Additional styling for responsive table */
  th, td {
    padding: 0.8rem 0.6rem;
  }

  table {
    table-layout: fixed;
    width: 100%;
  }

  /* Adjust column widths for mobile */
  .col-id {
    width: 15%;
  }

  .col-name {
    width: 45%;
  }

  .col-instrumento {
    width: 20%;
  }

  .col-actions {
    width: 20%;
  }

  /* Better styling for the details section on mobile */
  .details-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
    margin: 0.5rem;
  }

  .detail-item {
    padding: 0.6rem;
  }

  .detail-text-large {
    max-height: 200px;
  }
  
  /* Improved button styling for mobile */
  .detail-toggle {
    width: 100%;
    font-size: 0.8rem !important;
    padding: 0.4rem !important;
  }
  
  /* Add mobile-specific details header */
  .details-header {
    background-color: var(--accent-color);
    color: #000;
    text-align: center;
    padding: 0.7rem;
    margin: -1rem -1rem 1rem -1rem;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    letter-spacing: 1px;
  }
  
  /* Add a note about hidden columns */
  .mobile-note {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    padding: 0.5rem;
    color: var(--accent-color);
    font-style: italic;
    margin-bottom: 1rem;
  }
}

/* Animation for the detail section */
@keyframes fadeInSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-content.visible {
  animation: fadeInSlideDown 0.4s ease forwards;
}

/* Add some styling for expanded details */
.details-open .btn {
  background: var(--secondary-accent);
}

/* Styling for the no-data placeholder */
.no-data {
  font-style: italic;
  color: #666;
}

/* Enhanced responsive table styles */
.table-container {
  overflow-x: auto;
  position: relative;
  margin: 1rem 0;
  border-radius: 8px;
  background-color: var(--card-bg);
  -webkit-overflow-scrolling: touch; /* For smoother scrolling on iOS */
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

th, td {
  white-space: nowrap;
  padding: 1rem;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Priority columns that shouldn't shrink too much */
.col-id {
  width: 60px;
  min-width: 60px;
}

.col-name, .col-email {
  min-width: 180px;
}

.col-instrumento, .col-nivel {
  min-width: 120px;
}

.col-vocal, .col-lider {
  min-width: 90px;
}

.col-fecha {
  min-width: 110px;
}

.col-actions {
  min-width: 100px;
  text-align: center;
}

/* Details row styling improvements */
.detail-content {
  padding: 1.5rem;
  background-color: rgba(0,0,0,0.2);
  border-radius: 8px;
  margin: 0.5rem 1rem 1rem 1rem;
  overflow: hidden;
}

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

.detail-item {
  padding: 0.5rem;
}

.detail-item strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--accent-color);
}

.detail-item.full-width {
  grid-column: 1 / -1;
}

/* Scroll indicator for mobile */
.scroll-indicator {
  display: none;
  text-align: center;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent-color);
  font-size: 0.9rem;
  animation: fadeInOut 2s ease infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Hint animation for scrollable table */
.table-container.hint-scroll {
  animation: hintScroll 1.5s ease-in-out;
}

@keyframes hintScroll {
  0% { transform: translateX(0); }
  25% { transform: translateX(-20px); }
  75% { transform: translateX(20px); }
  100% { transform: translateX(0); }
}

/* Responsive table adjustments for mobile */
@media (max-width: 768px) {
  .scroll-indicator.active {
    display: block;
  }
  
  .table-container {
    background:
      /* Shadow on left edge */
      linear-gradient(to right, var(--card-bg), rgba(30, 30, 30, 0)) 0% 0%,
      /* Shadow on right edge */
      linear-gradient(to left, var(--card-bg), rgba(30, 30, 30, 0)) 100% 0%;
    background-size: 25px 100%, 25px 100%;
    background-repeat: no-repeat;
    background-attachment: local;
    /* Add a bit of space around the table for the shadows */
    padding-left: 5px;
    padding-right: 5px;
  }
  
  /* Add some fading effect to indicate more content is available horizontally */
  .table-container::before,
  .table-container::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15px;
    pointer-events: none;
    z-index: 1;
  }
  
  .table-container::before {
    left: 0;
    background: linear-gradient(to right, var(--card-bg), transparent);
  }
  
  .table-container::after {
    right: 0;
    background: linear-gradient(to left, var(--card-bg), transparent);
  }
  
  th, td {
    padding: 0.8rem 0.6rem;
  }
}

/* Enhanced table styles for better desktop display */
.table-container {
  margin: 0.5rem 0;
  /* Ensure table takes full available width */
  width: 100%;
}

table {
  width: 100%;
  table-layout: auto;
}

/* Adjust column widths for larger screens */
@media (min-width: 1200px) {
  .col-id {
    width: 5%;
    min-width: 60px;
  }
  
  .col-name {
    width: 15%;
    min-width: 180px;
  }
  
  .col-email {
    width: 15%;
    min-width: 180px;
  }
  
  .col-instrumento {
    width: 12%;
    min-width: 120px;
  }
  
  .col-vocal, .col-lider {
    width: 8%;
    min-width: 90px;
  }
  
  .col-nivel {
    width: 10%;
    min-width: 100px;
  }
  
  .col-fecha {
    width: 10%;
    min-width: 110px;
  }
  
  .col-actions {
    width: 8%;
    min-width: 100px;
    text-align: center;
  }
  
  /* Add more breathing room to the table cells */
  th, td {
    padding: 1rem 0.8rem;
  }
}

/* Adjustments for extra-large screens */
@media (min-width: 1800px) {
  .container {
    width: 96%;
  }
  
  /* Larger font size for better readability on very large displays */
  body {
    font-size: 16px;
  }
  
  th {
    font-size: 1rem;
  }
  
  /* More spacing in the table cells */
  th, td {
    padding: 1.2rem 1rem;
  }
  
  .card {
    padding: 2.5rem;
  }
  
  .dashboard-card {
    padding: 2rem;
  }
}
