/* Firebase Auth App - Common Styles */

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 20px;
  line-height: 1.6;
  background-color: #f8f9fa;
  color: #333;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 30px;
}

h1 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 30px;
  font-size: 2rem;
  font-weight: 300;
}

h2 {
  color: #34495e;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

/* Form Styles */
form {
  background-color: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #495057;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 20px;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

input.auto-filled {
  background-color: #fff3cd;
  border-color: #ffc107;
}

/* Button Styles */
button:not(.icon-btn),
.btn:not(.icon-btn) {
  display: inline-block;
  padding: 12px 24px;
  margin: 5px 10px 5px 0;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

button:not(.icon-btn):hover,
.btn:not(.icon-btn):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

button:not(.icon-btn):active,
.btn:not(.icon-btn):active {
  transform: translateY(0);
}

button:not(.icon-btn):disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

/* Button Colors */
.btn-primary,
button[type="submit"] {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover,
button[type="submit"]:hover {
  background-color: #2980b9;
}

.btn-success {
  background-color: #27ae60;
  color: white;
}

.btn-success:hover {
  background-color: #229954;
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-danger {
  background-color: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-admin {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.btn-admin:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.3);
}

.btn-admin: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;
}

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

/* User Info Styles */
.user-info {
  background-color: #ecf0f1;
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 25px;
  border-left: 4px solid #3498db;
}

.user-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.user-info li {
  margin-bottom: 15px;
  padding: 10px 0;
  border-bottom: 1px solid #bdc3c7;
}

.user-info li:last-child {
  border-bottom: none;
}

.user-info strong {
  color: #2c3e50;
  display: inline-block;
  min-width: 120px;
}

/* Permissions Styles */
.permissions {
  background-color: #e8f4fd;
  padding: 15px;
  border-radius: 6px;
  margin-top: 10px;
  border-left: 3px solid #3498db;
  font-family: 'Courier New', monospace;
}

/* Display Name Container */
.display-name-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.display-name-container input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.display-name-container input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Status Styles */
.login-status {
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 25px;
  border-left: 4px solid #3498db;
}

.login-status.logged-in {
  background-color: #d5f4e6;
  border-left-color: #27ae60;
  color: #155724;
}

.login-status:not(.logged-in) {
  background-color: #e8f4fd;
  border-left-color: #3498db;
  color: #0c5460;
}

/* Message Styles */
.message,
.success {
  padding: 15px 20px;
  border-radius: 6px;
  margin: 15px 0;
  border-left: 4px solid #27ae60;
  background-color: #d5f4e6;
  color: #155724;
}

.error {
  padding: 15px 20px;
  border-radius: 6px;
  margin: 15px 0;
  border-left: 4px solid #e74c3c;
  background-color: #f8d7da;
  color: #721c24;
}

.empty-state.error {
  text-align: center;
  padding: 30px;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  color: #721c24;
  margin: 20px 0;
}

.loading {
  color: #6c757d;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.auto-fill-note {
  font-size: 0.9em;
  color: #856404;
  background-color: #fff3cd;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  border-left: 3px solid #ffc107;
}

/* Actions Section */
.actions {
  margin-top: 30px;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.actions a {
  color: white;
}

.device-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #bdc3c7;
}

.device-session-row:last-child {
  border-bottom: none;
}

.device-session-details {
  min-width: 0;
}

.device-session-details strong,
.device-session-details span {
  display: block;
}

.device-session-details span {
  color: #6c757d;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .device-session-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Links */
a {
  color: #3498db;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #2980b9;
  text-decoration: underline;
}

.back-link {
  text-align: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .container {
    padding: 20px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .actions {
    text-align: center;
  }
  
  .actions a,
  .actions button {
    display: block;
    width: 100%;
    margin: 10px 0;
  }
  
  .user-info strong {
    display: block;
    min-width: auto;
    margin-bottom: 5px;
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.hidden {
  display: none;
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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