/**
 * Authentication Styles
 * 
 * This file contains styles for authentication-related UI components
 * including loading states, protected content, and auth buttons.
 */

/* Font Awesome Icon Fix - Ensure icons use correct font-family */
/* Override Tailwind's base font-family for Font Awesome icons */
.fa,
.fas,
.far,
.fal,
.fad,
.fab,
[class^="fa-"],
[class*=" fa-"] {
  font-family: inherit !important;
}

.fab,
.fa-brands {
  font-family: "Font Awesome 6 Brands", "Font Awesome 5 Brands" !important;
  font-weight: 400 !important;
  font-style: normal !important;
}

.fas,
.fa-solid {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
  font-weight: 900 !important;
  font-style: normal !important;
}

.far,
.fa-regular {
  font-family: "Font Awesome 6 Free", "Font Awesome 5 Free" !important;
  font-weight: 400 !important;
  font-style: normal !important;
}

/* Ensure proper rendering */
.fa:before,
.fas:before,
.far:before,
.fab:before {
  display: inline-block;
  font-style: normal;
  font-variant: normal;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

/* Loading States */
.auth-loading {
  position: relative;
  overflow: hidden;
}

.auth-loading::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 1000;
}

.auth-loading::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: 50px;
  height: 50px;
  margin-top: -25px;
  margin-left: -25px;
  border-radius: 50%;
  border: 5px solid rgba(0, 0, 0, 0.1);
  border-top-color: #007bff;
  animation: auth-spinner 0.8s linear infinite;
  z-index: 1001;
}

.auth-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  background-color: #f8f9fa;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
}

@keyframes auth-spinner {
  to {
    transform: rotate(360deg);
  }
}

/* Protected Content */
.protected-content {
  transition: opacity 0.3s ease;
}

.protected-content.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Auth Buttons */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.auth-btn-google {
  color: #fff;
  background-color: #4285f4;
  border-color: #4285f4;
}

.auth-btn-google:hover {
  color: #fff;
  background-color: #2a75f3;
  border-color: #1a69f2;
}

.auth-btn-google .auth-btn-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 0.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23FFC107' d='M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z'/%3E%3Cpath fill='%23FF3D00' d='M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z'/%3E%3Cpath fill='%234CAF50' d='M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z'/%3E%3Cpath fill='%231976D2' d='M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* User Avatar */
.auth-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #e9ecef;
  color: #495057;
  font-weight: 600;
  font-size: 1rem;
  overflow: hidden;
}

.auth-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 0.875rem;
}

.auth-avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
}

/* User Menu */
.auth-user-menu {
  position: relative;
}

.auth-user-menu-toggle {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
}

.auth-user-menu-toggle:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 0.25rem;
}

.auth-user-menu-toggle .auth-avatar {
  margin-right: 0.5rem;
}

.auth-user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 1000;
  display: none;
  min-width: 10rem;
  padding: 0.5rem 0;
  margin: 0.125rem 0 0;
  font-size: 1rem;
  color: #212529;
  text-align: left;
  list-style: none;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.25rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
}

.auth-user-menu.open .auth-user-menu-dropdown {
  display: block;
}

.auth-user-menu-item {
  display: block;
  width: 100%;
  padding: 0.25rem 1.5rem;
  clear: both;
  font-weight: 400;
  color: #212529;
  text-align: inherit;
  white-space: nowrap;
  background-color: transparent;
  border: 0;
  text-decoration: none;
}

.auth-user-menu-item:hover {
  color: #16181b;
  text-decoration: none;
  background-color: #f8f9fa;
}

.auth-user-menu-divider {
  height: 0;
  margin: 0.5rem 0;
  overflow: hidden;
  border-top: 1px solid #e9ecef;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .auth-user-menu-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    margin-top: 0.5rem;
  }
  
  .auth-user-menu-toggle {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .auth-user-menu-toggle .auth-avatar {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
} 