/* Modal Styles */
.modal {
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.modal.show {
  display: flex !important;
}

.modal-content {
  background-color: #fff;
  margin: auto;
  width: 100%;
  max-width: 500px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.3s ease-out;
  overflow: hidden;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalFadeIn {
  from {transform: translateY(-30px); opacity: 0;}
  to {transform: translateY(0); opacity: 1;}
}

.modal-header {
  position: relative;
  padding: 15px 20px;
  text-align: center;
  border-bottom: 1px solid #eee;
  background-color: white;
}

.modal-header h2 {
  margin: 0;
  color: #004b8d;
  font-size: 20px;
  font-weight: 700;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #888;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  font-weight: bold;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-modal:hover {
  background-color: #f0f0f0;
  color: #333;
}

.modal-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* Internet Explorer/Edge */
  background-color: #f5f5f5;
}

.modal-tabs::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.tab-btn {
  flex: 1;
  min-width: 110px;
  padding: 15px 10px;
  background-color: #f5f5f5;
  border: none;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  text-decoration: none;
  text-align: center;
  border-bottom: 3px solid transparent;
  font-weight: normal;
  transition: all 0.2s ease;
}

.tab-btn svg {
  margin-bottom: 8px;
  color: #666;
}

.tab-btn.active {
  background-color: white;
  color: #004b8d;
  border-bottom: 3px solid #004b8d;
  font-weight: 600;
}

.tab-btn.active:after {
  width: 100%;
}

.tab-btn.active svg {
  color: #004b8d;
}

.tab-icon {
  font-size: 18px;
  margin-bottom: 5px;
}

.tab-content {
  padding: 20px;
  display: none;
}

.form-group {
  margin-bottom: 15px;
}

.select-dropdown {
  position: relative;
}

.select-item {
  height: 45px;
  border: 1px solid #ddd;
  border-radius: 5px;
  display: flex;
  align-items: center;
  padding: 0 15px;
  cursor: pointer;
  position: relative;
  background-color: white;
}

.flag-icon {
  margin-right: 10px;
  font-size: 20px;
}

.dropdown-icon {
  margin-left: auto;
  color: #888;
  font-size: 12px;
}

.form-input {
  width: 100%;
  height: 45px;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 0 15px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: #004b8d;
  box-shadow: 0 0 0 2px rgba(0, 75, 141, 0.1);
}

.phone-input-group {
  display: flex;
  border: 1px solid #ddd;
  border-radius: 5px;
  overflow: hidden;
}

.country-code {
  padding: 0 10px;
  background-color: #f5f5f5;
  border-right: 1px solid #ddd;
  display: flex;
  align-items: center;
  font-weight: bold;
  color: #333;
  min-width: 70px;
  justify-content: center;
}

.phone-number {
  flex: 1;
  border: none;
  border-radius: 0;
  height: 45px;
  padding: 0 15px;
}

.register-btn {
  background-color: #8bc34a;
  color: white;
  border: none;
  height: 45px;
  width: 100%;
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
}

.register-btn:hover {
  background-color: #7cb342;
}

.register-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.terms-text {
  font-size: 12px;
  color: #777;
  margin-top: 15px;
  line-height: 1.4;
}

.terms-text a {
  color: #004b8d;
  text-decoration: none;
}

.terms-text a:hover {
  text-decoration: underline;
}

.privacy-link {
  color: #004b8d;
}

.terms-link {
  color: #004b8d;
}

.social-icons {
  display: flex;
  gap: 15px;
  justify-content: center;
  padding: 15px 0;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-icon.telegram {
  background-color: #0088cc;
  color: white;
}

.social-icon.google {
  background-color: #DB4437;
  color: white;
}

.social-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Country dropdown styles */
.country-dropdown-list {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  width: 100%;
  top: 100%;
  left: 0;
}

.dropdown-search {
  padding: 10px;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1001;
}

.search-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.search-input:focus {
  border-color: #007bff;
}

.dropdown-options {
  max-height: 250px;
  overflow-y: auto;
}

.dropdown-option {
  display: flex;
  align-items: center;
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
}

.dropdown-option:hover {
  background-color: #f8f9fa;
}

.dropdown-option:last-child {
  border-bottom: none;
}

.dropdown-option .flag-icon {
  margin-right: 8px;
  width: 20px;
  height: 15px;
  object-fit: cover;
  flex-shrink: 0;
}

.country-dropdown-trigger {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: white;
  height: 45px;
  box-sizing: border-box;
}

.country-dropdown-trigger:hover {
  border-color: #007bff;
}

.country-name {
  flex-grow: 1;
  margin-left: 8px;
}

.flag-icon {
  width: 20px;
  height: 15px;
  object-fit: cover;
  flex-shrink: 0;
}

.dropdown-icon {
  margin-left: auto;
  color: #888;
  font-size: 12px;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.dropdown-icon.rotated {
  transform: rotate(180deg);
}

/* Disabled tab styling */
.tab-btn.tab-disabled {
  pointer-events: none;
}

/* Currency dropdown styling */
.currency-select .select-item {
  height: 45px;
  border: 1px solid #ddd;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  cursor: pointer;
  background-color: white;
  font-size: 14px;
  color: #333;
}

.currency-select .select-item:hover {
  border-color: #007bff;
}

.currency-select .dropdown-icon {
  margin-left: auto;
  color: #888;
  font-size: 12px;
  flex-shrink: 0;
}

/* Currency dropdown list styling */
.currency-dropdown-list {
  position: absolute;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  top: 100%;
  left: 0;
}

.currency-dropdown-list .dropdown-option {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.2s;
  font-size: 14px;
}

.currency-dropdown-list .dropdown-option:hover {
  background-color: #f8f9fa;
}

.currency-dropdown-list .dropdown-option:last-child {
  border-bottom: none;
}

.currency-text {
  flex-grow: 1;
  text-align: left;
}

/* Login Dropdown Styles */
#login-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 10000;
  width: 320px;
  display: none;
  padding: 20px;
  margin-top: 1px;
}

/* Ensure the login container has proper positioning */
#login-container {
  position: relative;
  height: 40px;
}

/* Hide login dropdown on mobile/tablet screens */
@media (max-width: 768px) {
  #login-dropdown {
    display: none !important;
  }
  
  /* Ensure the desktop login button doesn't show dropdown on mobile */
  #login-container .btn.login {
    pointer-events: auto;
  }
  
  /* Hide desktop login button on mobile */
  #login-container {
    display: none !important;
  }
}

/* Desktop-only login dropdown behavior */
@media (min-width: 769px) {
  #login-dropdown {
    display: none;
  }
  
  #login-dropdown.show {
    display: block !important;
  }
  
  /* Ensure desktop login container is visible */
  #login-container {
    display: block !important;
  }
}

/* Login dropdown form styles */
#login-dropdown form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

#login-dropdown input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

#login-dropdown input:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

#login-dropdown button[type="submit"] {
  background: #0066cc;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

#login-dropdown button[type="submit"]:hover {
  background: #0052a3;
}

/* Social login buttons in dropdown */
#login-dropdown .social-login-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#login-dropdown .social-login-buttons button {
  padding: 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  transition: background 0.2s;
}

#login-dropdown .social-login-buttons button:hover {
  opacity: 0.9;
}

/* Dropdown arrow/indicator */
#login-dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #ddd;
}

#login-dropdown::after {
  content: '';
  position: absolute;
  top: -7px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid white;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .modal-content {
    width: 90%;
  }
  
  .modal-tabs {
    flex-wrap: nowrap;
  }
}

@media (max-width: 576px) {
  .modal-content {
    max-width: 90%;
    margin: 10px;
  }
  
  .modal-tabs {
    flex-wrap: wrap;
  }
  
  .tab-btn {
    min-width: calc(50% - 2px);
    font-size: 12px;
    padding: 10px 5px;
  }
}

@media (max-width: 768px) {
  .modal-content {
    max-height: 95vh;
    margin: 20px;
    border-radius: 8px;
  }
  
  .modal {
    padding: 10px;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
  }
  
  .country-dropdown-list {
    position: fixed;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 85vw !important;
    max-width: 350px !important;
    max-height: 60vh !important;
    z-index: 11000 !important;
  }
  
  /* Mobile: Hide desktop login dropdown completely */
  #login-container {
    display: none !important;
  }
  
  #login-dropdown {
    display: none !important;
  }
  
  /* Show mobile login button */
  .mobile-auth-btn {
    display: inline-flex !important;
  }
}

/* Ensure dropdown doesn't interfere with mobile layout */
@media (max-width: 768px) {
  .actions {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
}

/* Desktop and Mobile Login Behavior */
@media (min-width: 769px) {
  /* Desktop: Show login dropdown container, hide mobile login buttons */
  #login-container {
    display: block !important;
  }
  
  .mobile-auth-btn {
    display: none !important;
  }
  
  /* Mobile login modal should be hidden when not active */
  #login-modal {
    display: none;
  }
}
