/* Modern Glassmorphism Login Modal */
.login-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.7));
  backdrop-filter: blur(15px);
  animation: fadeInBackdrop 0.4s ease;
  align-items: center;
  justify-content: center;
}

@keyframes fadeInBackdrop {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to { opacity: 1; backdrop-filter: blur(15px); }
}

.login-modal-content {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin: auto;
  padding: 50px 40px;
  border-radius: 25px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: modalSlideIn 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  .login-modal-content {
    margin: auto;
    padding: 30px 20px;
    width: 95vw;
    border-radius: 20px;
  }

  .login-form h2 {
    font-size: 1.8rem !important;
  }

  .login-form input {
    padding: 18px 20px 18px 45px !important;
    font-size: 14px !important;
  }

  .input-icon {
    left: 15px !important;
    font-size: 16px !important;
  }

  .login-form button {
    padding: 16px !important;
    font-size: 15px !important;
  }

  .close-login {
    width: 35px !important;
    height: 35px !important;
    font-size: 24px !important;
    top: 15px !important;
    right: 20px !important;
  }
}





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

/* Enhanced floating background */




.login-form {
  display: flex;
  flex-direction: column;
  gap: 30px;
  position: relative;
  z-index: 1;
}

.login-form h2 {
  text-align: center;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 20px;
  font-size: 2.2rem;
  font-weight: 700;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  letter-spacing: -1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.input-group {
  position: relative;
  margin-bottom: 10px;
}

.input-group button {
  margin: 0 !important;
}

.login-form input,
.login-form select {
  width: 100%;
  padding: 22px 25px 22px 50px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    inset 0 2px 15px rgba(0, 0, 0, 0.15),
    0 4px 20px rgba(0, 0, 0, 0.1);
  font-weight: 500;
  letter-spacing: 0.5px;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.login-form select {
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="rgba(255,255,255,0.7)" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 20px center;
  background-size: 12px;
  padding-right: 50px;
}

.login-form select option {
  background: rgba(30, 30, 30, 0.95);
  color: rgba(255, 255, 255, 0.95);
  padding: 10px;
  border: none;
}

.login-form input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
  transition: all 0.3s ease;
}

.input-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 18px;
  transition: all 0.4s ease;
  z-index: 2;
}

.login-form input:focus,
.login-form select:focus {
  outline: none;
  border-color: rgba(103, 126, 234, 0.8) !important;
  background: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 
    inset 0 2px 15px rgba(0, 0, 0, 0.15),
    0 0 0 4px rgba(103, 126, 234, 0.15),
    0 12px 35px rgba(103, 126, 234, 0.2),
    0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

.login-form input:focus::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.login-form input:focus + .input-icon {
  color: rgba(103, 126, 234, 0.8);
}

.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus,
.login-form input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.08) inset !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.95) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 2px solid rgba(255, 255, 255, 0.15) !important;
  -webkit-transition: background-color 5000s ease-in-out 0s !important;
  transition: background-color 5000s ease-in-out 0s !important;
}

.login-form button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #667eea 100%);
  background-size: 200% 200%;
  color: white;
  border: none;
  padding: 20px;
  border-radius: 18px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 10px 30px rgba(102, 126, 234, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 10px;
}

.login-form button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.login-form button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.login-form button:hover::before {
  left: 100%;
}

.login-form button:hover::after {
  width: 300px;
  height: 300px;
}

.login-form button:hover {
  transform: translateY(-4px) scale(1.02);
  background-position: 100% 0;
  box-shadow: 
    0 20px 40px rgba(102, 126, 234, 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.login-form button:active {
  transform: translateY(-2px) scale(0.98);
  transition: all 0.1s ease;
}

.close-login {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 20px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s ease;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.close-login:hover {
  color: rgba(255, 255, 255, 1);
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg) scale(1.1);
}

/* Modern Glassmorphism Logout Modal */
.logout-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.2), rgba(0, 0, 0, 0.6));
  backdrop-filter: blur(15px);
  animation: fadeInBackdrop 0.4s ease;
  align-items: center;
  justify-content: center;
}

.logout-modal-content {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin: auto;
  padding: 45px 40px;
  border-radius: 25px;
  width: 450px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: modalSlideIn 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  .logout-modal-content {
    margin: auto;
    padding: 30px 20px;
    width: 95vw;
    border-radius: 20px;
  }

  .logout-modal h3 {
    font-size: 1.5rem !important;
  }

  .logout-modal p {
    font-size: 1rem !important;
  }

  .logout-modal-buttons {
    flex-direction: column;
    gap: 15px !important;
  }

  .logout-btn-modal {
    padding: 12px 20px !important;
    font-size: 14px !important;
  }
}



.logout-modal h3 {
  margin-bottom: 15px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.8rem;
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logout-modal p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  margin-bottom: 30px;
  line-height: 1.5;
}

.logout-modal-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 30px;
}

.logout-btn-modal {
  padding: 15px 30px;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.logout-btn-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.logout-btn-modal:hover::before {
  left: 100%;
}

.logout-btn-modal.cancel {
  background: rgba(108, 117, 125, 0.3);
  border: 1px solid rgba(108, 117, 125, 0.4);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 25px rgba(108, 117, 125, 0.2);
}

.logout-btn-modal.cancel:hover {
  background: rgba(108, 117, 125, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(108, 117, 125, 0.3);
}

.logout-btn-modal.confirm {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  border: 1px solid rgba(220, 53, 69, 0.4);
  color: white;
  box-shadow: 0 8px 25px rgba(220, 53, 69, 0.3);
}

.logout-btn-modal.confirm:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(220, 53, 69, 0.4);
}

.logout-btn-modal:active {
  transform: translateY(-1px);
}

/* Error message styling */
.error-message {
  background: rgba(220, 53, 69, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(220, 53, 69, 0.3);
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  font-weight: 500;
  display: none;
  animation: errorSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 25px rgba(220, 53, 69, 0.2);
  position: relative;
  overflow: hidden;
}

.error-message::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(220, 53, 69, 0.1), transparent);
  animation: errorShimmer 2s infinite;
}

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

@keyframes errorShimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.error-message i {
  margin-right: 10px;
  color: rgba(220, 53, 69, 0.8);
}

/* Dark theme adjustments for glassmorphism modals */
[data-theme="dark"] .login-modal-content,
[data-theme="dark"] .logout-modal-content {
  background: rgba(30, 30, 30, 0.25);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .login-form input,
[data-theme="dark"] .login-form select {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .login-form input:focus,
[data-theme="dark"] .login-form select:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(103, 126, 234, 0.5);
}

[data-theme="dark"] .login-form input:-webkit-autofill,
[data-theme="dark"] .login-form input:-webkit-autofill:hover,
[data-theme="dark"] .login-form input:-webkit-autofill:focus,
[data-theme="dark"] .login-form input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.05) inset !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.95) !important;
  -webkit-transition: background-color 5000s ease-in-out 0s !important;
  transition: background-color 5000s ease-in-out 0s !important;
}