/* Login and Authentication Pages Styling */

/* Login Container */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  padding: 20px;
}

/* Login Card */
.login-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  max-width: 1000px;
  width: 100%;
  min-height: 600px;
}

/* Logo Section */
.login-logo-section {
  flex: 0 0 50%;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-logo-section img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Form Section */
.login-form-section {
  flex: 0 0 50%;
  padding: 60px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Password hint styling */
.password-hint {
  font-size: 0.875rem;
  color: #6b7280;
  font-style: italic;
  margin-bottom: 8px;
  display: block;
}

.login-form-section h2 {
  color: #333;
  margin-bottom: 15px;
  font-size: 2rem;
  font-weight: 600;
}

.welcome-subtitle {
  color: #666;
  font-size: 1.1rem;
  margin-bottom: 30px;
  text-align: center;
  line-height: 1.4;
}

/* Error Messages Styling */
#error_explanation {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  color: #721c24;
}

#error_explanation h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #721c24;
}

#error_explanation ul {
  margin: 0;
  padding-left: 20px;
}

#error_explanation li {
  margin-bottom: 5px;
  font-size: 0.9rem;
}

/* Form Styling */
.login-form .field {
  margin-bottom: 25px;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
}

.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"] {
  width: 100%;
  padding: 15px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus,
.login-form input[type="text"]:focus {
  outline: none;
  border-color: #007bff;
}

/* Remember Me */
.login-form .remember-me {
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-form .remember-me input[type="checkbox"] {
  margin: 0;
  transform: scale(1.1);
}

/* Actions */
.login-form .actions {
  margin-bottom: 25px;
}

.login-form .actions input[type="submit"],
.login-form .actions .btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-form .actions input[type="submit"]:hover,
.login-form .actions .btn:hover {
  background: #0056b3;
}

/* Login Links */
.login-links {
  text-align: center;
  margin-top: 20px;
}

.login-links a {
  color: #007bff;
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-block;
  margin: 5px 0;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.login-links a:hover {
  text-decoration: none;
  background-color: #f8f9fa;
  color: #0056b3;
}

/* Forgot Password Section */
.forgot-password-section {
  text-align: right;
  margin-bottom: 25px;
}

/* Forgot Password Link */
.forgot-password-link {
  color: #6c757d !important;
  font-size: 0.85rem !important;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.forgot-password-link:hover {
  color: #495057 !important;
  text-decoration: underline;
}

/* Form Check Styling */
.login-form .form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 25px;
}

.login-form .form-check-input {
  margin: 0;
  transform: scale(1.1);
  margin-top: 2px;
  flex-shrink: 0;
}

.login-form .form-check-label {
  line-height: 1.4;
  flex: 1;
  color: #555;
}

/* Centered Form Container (for chessboard creation page) */
.centered-form-container {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  padding: 20px;
}

.centered-form-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 40px;
  max-width: 600px;
  width: 100%;
  border: 1px solid #e1e5e9;
  text-align: left;
}

.centered-form-card h2 {
  color: #333;
  margin-bottom: 30px;
  font-size: 1.8rem;
  font-weight: 600;
  text-align: left;
}

/* Welcome Message */
.welcome-message {
  text-align: center;
  margin-bottom: 30px;
}

.welcome-message h1 {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0;
}

/* Top Navigation Bar */
.top-navigation {
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 15px 0;
}

.nav-container {
  width: 100%;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: -20px;
  padding-left: 20px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
}

.nav-logo-link {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-logo {
  height: 60px;
  width: auto;
  object-fit: contain;
  transform: scale(1.2);
}

.nav-welcome {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.nav-welcome .welcome-text {
  color: #333;
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0;
}


.nav-btn {
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  display: inline-block;
}

.nav-btn:hover {
  background: #0056b3;
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.nav-logout {
  background: #dc3545 !important;
  color: white !important;
}

.nav-logout:hover {
  background: #c82333 !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
}

.nav-playroom-form {
  display: inline-block;
}

.nav-playrooms {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
}

.nav-playroom-container {
  position: relative;
  display: inline-block;
  height: 40px;
  vertical-align: top;
}

.nav-playroom-btn {
  background: #6c757d !important;
  font-size: 0.8rem !important;
  padding: 6px 35px 6px 12px !important;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 100%;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.nav-playroom-btn:hover {
  background: #5a6268 !important;
  color: white !important;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3) !important;
}

.nav-playroom-delete-form {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 30px !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 10 !important;
}

.nav-playroom-delete {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  background: transparent !important;
  color: black !important;
  border: 1px solid black !important;
  border-radius: 0 6px 0 6px !important;
  width: 30px !important;
  height: 40px !important;
  font-size: 16px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  line-height: 1 !important;
  transition: all 0.2s ease !important;
  z-index: 10 !important;
  pointer-events: auto !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.nav-playroom-delete:hover {
  background: rgba(108, 117, 125, 0.1) !important;
  color: black !important;
}

.nav-playroom-delete:active {
  transform: scale(0.95);
}

.delete-cross {
  font-size: 14px;
  line-height: 1;
}

/* Loading Bar */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(0, 0, 0, 0.1);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-bar.show {
  opacity: 1;
  visibility: visible;
}

.loading-progress {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #0056b3);
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.loading-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-image: linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 50px 50px;
  animation: move 2s linear infinite;
}

@keyframes move {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 50px 50px;
  }
}

/* Clipboard feedback styles */
.clipboard-success {
  background: #28a745 !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3) !important;
}

.clipboard-error {
  background: #dc3545 !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3) !important;
}

/* Flash Messages */
.flash-messages {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 1000;
}

.flash-messages .alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* List Card Styling */
.list-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 30px;
  max-width: 800px;
  width: 100%;
  border: 1px solid #e1e5e9;
}

.chessboards-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.chessboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e1e5e9;
  transition: all 0.3s ease;
}

.chessboard-item:hover {
  background: #e9ecef;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chessboard-info {
  flex: 1;
}

.chessboard-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 5px;
}

.chessboard-id {
  color: #666;
  font-size: 0.9rem;
}

.chessboard-actions {
  display: flex;
  gap: 10px;
}

.chessboard-actions .btn {
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.empty-state h3 {
  margin-bottom: 15px;
  color: #333;
}

/* Chessboard Show Page Styling */
.chessboard-show-container {
  min-height: 100vh;
  background: white;
  padding: 20px;
}

.chessboard-show-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 30px;
  max-width: 1200px;
  margin: 0 auto;
  border: 1px solid #e1e5e9;
}

.chessboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e1e5e9;
}

.chessboard-actions {
  display: flex;
  gap: 15px;
}

.playroom-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.playrooms-section {
  margin-bottom: 30px;
}

.playrooms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.playroom-link {
  display: inline-block;
  padding: 8px 16px;
  background: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background-color 0.3s ease;
}

.playroom-link:hover {
  background: #0056b3;
  color: white;
}

.chessboard-main-content {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.video-conference-section {
  flex: 1;
  min-width: 300px;
}

.chessboard-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  min-height: 400px;
}

.chessboard-section {
  flex: 1;
  order: 2;
}

.timer-section {
  flex: 1;
  order: 3;
}

.clock-controls-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  order: 1;
  justify-content: center;
  height: 100%;
}

#chess-clock-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  align-items: center !important;
}

.clock-btn {
  font-size: 1.5rem;
  padding: 6px !important;
  min-width: 35px !important;
  min-height: 35px !important;
  max-width: 35px !important;
  max-height: 35px !important;
  width: 35px !important;
  height: 35px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  line-height: 1 !important;
  background: transparent !important;
  border: 1px solid #dee2e6 !important;
  transition: all 0.3s ease;
}

.clock-btn:hover {
  background: #f8f9fa !important;
  transform: scale(1.1);
}

.clock-btn::after {
  content: attr(title);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.clock-btn::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-bottom-color: #333;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
}

.clock-btn:hover::after,
.clock-btn:hover::before {
  opacity: 1;
  visibility: visible;
}


/* Responsive Design */
@media (max-width: 768px) {
  .login-card {
    flex-direction: column;
    max-width: 100%;
  }
  
  .login-logo-section,
  .login-form-section {
    flex: 1;
  }
  
  .login-logo-section {
    padding: 30px 20px;
  }
  
  .login-form-section {
    padding: 40px 20px;
  }
  
  .welcome-message h1 {
    font-size: 1.8rem;
  }
  
  .chessboard-header {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
  }
  
  .chessboard-layout {
    flex-direction: column;
    gap: 20px;
  }
  
  .chessboard-actions {
    flex-direction: column;
  }
  
  .playroom-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  .clock-controls-section {
    order: 2;
    flex-direction: row;
    justify-content: center;
    min-width: auto;
  }
  
  #chess-clock-controls {
    flex-direction: row;
    gap: 15px;
  }
  
  .chessboard-section {
    order: 1;
  }
  
  .timer-section {
    order: 3;
  }
  
  /* Top Navigation Responsive */
  .nav-container {
    flex-direction: column;
    gap: 15px;
    padding: 10px 20px;
  }
  
  .nav-left {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .nav-logo {
    height: 50px;
    transform: scale(1.1);
  }
  
  .nav-welcome .welcome-text {
    font-size: 1rem;
  }
  
  .nav-right {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .nav-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  
  .nav-playroom-btn {
    font-size: 0.75rem !important;
    padding: 4px 8px !important;
    max-width: 100px;
  }
  
  .nav-playrooms {
    flex-wrap: wrap;
    gap: 5px;
    margin-left: 0;
    margin-top: 10px;
  }
}
