/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Space Theme Styling */
body {
  background: linear-gradient(135deg, #0a0e27 0%, #1a1a2e 50%, #16213e 100%);
  background-attachment: fixed;
  color: #e0e0e0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* Navigation Bar */
.space-nav {
  background: linear-gradient(135deg, rgba(10, 14, 39, 0.95), rgba(22, 33, 62, 0.95));
  border-bottom: 2px solid rgba(0, 212, 255, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 212, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #00d4ff;
  text-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.nav-icon {
  font-size: 2rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-link {
  color: #00d4ff;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: 2px solid rgba(0, 212, 255, 0.3);
  border-radius: 20px;
  transition: all 0.3s ease;
  background: rgba(0, 212, 255, 0.05);
  font-weight: 500;
  margin: 0;
}

.nav-link:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: #00d4ff;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
  transform: translateY(-2px);
}

.nav-link-primary {
  background: linear-gradient(135deg, #7b2cbf, #5a189a);
  border-color: #9d4edd;
  color: #e0e0e0;
}

.nav-link-primary:hover {
  background: linear-gradient(135deg, #9d4edd, #7b2cbf);
  border-color: #c77dff;
  box-shadow: 0 0 20px rgba(123, 44, 191, 0.6);
  color: #e0e0e0;
}

/* Main Content */
.main-content {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Footer */
.space-footer {
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
  border-top: 1px solid rgba(0, 212, 255, 0.3);
  color: rgba(224, 224, 224, 0.6);
  font-size: 0.9rem;
}

/* Page Header */
.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.page-subtitle {
  color: rgba(0, 212, 255, 0.7);
  font-size: 1.1rem;
  margin-top: -1rem;
}

h1, h2 {
  color: #00d4ff;
  text-align: center;
  font-size: 2.5rem;
  text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
  margin-bottom: 2rem;
}

h2 {
  font-size: 1.8rem;
}

/* Notice and success messages */
p[style*="color: green"] {
  background: rgba(0, 255, 136, 0.1);
  border-left: 4px solid #00ff88;
  padding: 1rem;
  border-radius: 8px;
  color: #00ff88 !important;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
  max-width: 800px;
  margin: 0 auto 2rem;
}

/* Error messages */
div[style*="color: red"] {
  background: rgba(255, 50, 50, 0.1) !important;
  border-left: 4px solid #ff3232;
  padding: 1rem;
  border-radius: 8px;
  color: #ff6b6b !important;
  box-shadow: 0 0 15px rgba(255, 50, 50, 0.2);
  max-width: 800px;
  margin: 0 auto 2rem;
}

div[style*="color: red"] h2 {
  color: #ff6b6b !important;
  font-size: 1.2rem;
  text-align: left;
  text-shadow: none;
  margin-bottom: 1rem;
}

div[style*="color: red"] ul {
  margin: 0;
  padding-left: 1.5rem;
}

div[style*="color: red"] li {
  color: #ff6b6b !important;
  margin-bottom: 0.5rem;
}

/* Users and Pets containers */
#users, #pets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Card styling */
.card {
  background: linear-gradient(145deg, rgba(26, 26, 46, 0.8), rgba(22, 33, 62, 0.8));
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 15px;
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 212, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 212, 255, 0.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 212, 255, 0.3);
}

.card:hover::before {
  opacity: 1;
}

/* Card actions */
.card-actions {
  margin-top: 1rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.btn-card {
  color: #00d4ff;
  text-decoration: none;
  padding: 0.6rem 1.5rem;
  border: 2px solid #00d4ff;
  border-radius: 25px;
  display: inline-block;
  transition: all 0.3s ease;
  background: rgba(0, 212, 255, 0.1);
  font-weight: 500;
  margin: 0;
}

.btn-card:hover {
  background: #00d4ff;
  color: #0a0e27;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
  transform: scale(1.05);
}

/* Field styling within cards */
div[id^="user_"] > div, div[id^="pet_"] > div {
  margin-bottom: 0.8rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border-left: 3px solid #7b2cbf;
}

div[id^="user_"] > div:last-child, div[id^="pet_"] > div:last-child {
  margin-bottom: 0;
}

strong {
  color: #00d4ff;
  font-weight: 600;
  display: inline-block;
  min-width: 80px;
}

/* Show page single card */
body > div[id^="user_"], body > div[id^="pet_"] {
  background: linear-gradient(145deg, rgba(26, 26, 46, 0.8), rgba(22, 33, 62, 0.8));
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 212, 255, 0.1);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.show-container {
  max-width: 700px;
  margin: 0 auto;
}

.show-container > div[id^="user_"],
.show-container > div[id^="pet_"] {
  background: linear-gradient(145deg, rgba(26, 26, 46, 0.8), rgba(22, 33, 62, 0.8));
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 212, 255, 0.1);
  margin-bottom: 2rem;
}

/* Action buttons container */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 15px;
}

.btn-edit, .btn-back, .btn-pets {
  color: #00d4ff;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border: 2px solid #00d4ff;
  border-radius: 25px;
  display: inline-block;
  transition: all 0.3s ease;
  background: rgba(0, 212, 255, 0.1);
  font-weight: 500;
  margin: 0;
}

.btn-edit:hover, .btn-back:hover, .btn-pets:hover {
  background: #00d4ff;
  color: #0a0e27;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
  transform: translateY(-2px);
}

.btn-pets {
  background: linear-gradient(135deg, #7b2cbf, #5a189a);
  border-color: #9d4edd;
  color: #e0e0e0;
}

.btn-pets:hover {
  background: linear-gradient(135deg, #9d4edd, #7b2cbf);
  border-color: #c77dff;
  box-shadow: 0 0 25px rgba(123, 44, 191, 0.6);
  color: #e0e0e0;
}

.btn-delete {
  background: linear-gradient(135deg, #c9184a, #a4133c);
  border: 2px solid #ff4d6d;
  color: #e0e0e0;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 20px rgba(201, 24, 74, 0.3);
}

.btn-delete:hover {
  background: linear-gradient(135deg, #ff4d6d, #c9184a);
  border-color: #ff758f;
  box-shadow: 0 0 30px rgba(255, 77, 109, 0.6);
  transform: translateY(-2px);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(145deg, rgba(26, 26, 46, 0.5), rgba(22, 33, 62, 0.5));
  border: 2px dashed rgba(0, 212, 255, 0.3);
  border-radius: 15px;
  margin: 2rem auto;
  max-width: 600px;
}

.empty-state p {
  font-size: 1.2rem;
  color: rgba(0, 212, 255, 0.7);
  margin: 0;
}

/* Floating action buttons */
.floating-action {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 999;
}

.btn-floating {
  background: linear-gradient(135deg, #7b2cbf, #5a189a);
  border: 2px solid #9d4edd;
  color: #e0e0e0;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(123, 44, 191, 0.5);
  transition: all 0.3s ease;
  display: inline-block;
  margin: 0;
}

.btn-floating:hover {
  background: linear-gradient(135deg, #9d4edd, #7b2cbf);
  border-color: #c77dff;
  box-shadow: 0 6px 30px rgba(157, 78, 221, 0.7);
  transform: translateY(-3px) scale(1.05);
  color: #e0e0e0;
}

.btn-floating-secondary {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 150, 200, 0.2));
  border: 2px solid #00d4ff;
  color: #00d4ff;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
  transition: all 0.3s ease;
  display: inline-block;
  margin: 0;
}

.btn-floating-secondary:hover {
  background: #00d4ff;
  color: #0a0e27;
  box-shadow: 0 6px 30px rgba(0, 212, 255, 0.6);
  transform: translateY(-3px) scale(1.05);
}

/* Link styling */
a {
  color: #00d4ff;
  text-decoration: none;
  transition: all 0.3s ease;
}

/* Show link within cards - removed as we're using card-actions now */

/* Forms */
form {
  background: linear-gradient(145deg, rgba(26, 26, 46, 0.8), rgba(22, 33, 62, 0.8));
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 212, 255, 0.1);
  max-width: 600px;
  margin: 0 auto 2rem;
}

form > div {
  margin-bottom: 1.5rem;
}

/* Form actions */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem auto;
  max-width: 600px;
  flex-wrap: wrap;
}

.btn-secondary {
  color: #00d4ff;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border: 2px solid #00d4ff;
  border-radius: 25px;
  display: inline-block;
  transition: all 0.3s ease;
  background: rgba(0, 212, 255, 0.1);
  font-weight: 500;
  margin: 0;
}

.btn-secondary:hover {
  background: rgba(0, 212, 255, 0.2);
  border-color: #00d4ff;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
  transform: translateY(-2px);
}

/* Form labels */
label {
  color: #00d4ff;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* Form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(0, 212, 255, 0.3);
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #00d4ff;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
  background: rgba(0, 0, 0, 0.4);
}

/* Submit buttons */
input[type="submit"] {
  background: linear-gradient(135deg, #7b2cbf, #5a189a);
  border: 2px solid #9d4edd;
  color: #e0e0e0;
  padding: 0.8rem 2rem;
  border-radius: 25px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 25px rgba(123, 44, 191, 0.4);
  width: 100%;
}

input[type="submit"]:hover {
  background: linear-gradient(135deg, #9d4edd, #7b2cbf);
  border-color: #c77dff;
  box-shadow: 0 0 35px rgba(157, 78, 221, 0.6);
  transform: translateY(-2px);
}

/* Delete/Destroy buttons */
button, input[type="submit"][value*="Destroy"] {
  background: linear-gradient(135deg, #c9184a, #a4133c);
  border: 2px solid #ff4d6d;
  color: #e0e0e0;
  padding: 0.8rem 2rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 25px rgba(201, 24, 74, 0.4);
}

button:hover, input[type="submit"][value*="Destroy"]:hover {
  background: linear-gradient(135deg, #ff4d6d, #c9184a);
  border-color: #ff758f;
  box-shadow: 0 0 35px rgba(255, 77, 109, 0.6);
  transform: translateY(-2px);
}

/* Fix button_to form wrapper styling */
.action-buttons form,
div[style*="display: flex"] form,
div[style*="display: grid"] form {
  all: unset;
  display: inline-block;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.action-buttons form button,
div[style*="display: flex"] form button,
div[style*="display: grid"] form button {
  width: auto;
  display: inline-block;
}

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid rgba(0, 212, 255, 0.3);
  margin: 2rem 0;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #users, #pets {
    grid-template-columns: 1fr;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .nav-container {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .nav-links {
    flex-direction: column;
    width: 100%;
  }
  
  .nav-link {
    width: 100%;
    text-align: center;
  }
  
  .floating-action {
    bottom: 1rem;
    right: 1rem;
  }
  
  .btn-floating, .btn-floating-secondary {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .action-buttons a,
  .action-buttons button {
    width: 100%;
  }
}
