/**
 * KK Frontend Authentication Styles
 */

/* Modal Overlay */
.kk-auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999999;
  display: none;
  overflow-y: auto;
}

/* Modal Container */
.kk-auth-modal {
  position: relative;
  width: 90%;
  max-width: 450px;
  margin: 50px auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Close Button */
.kk-auth-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #999;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
  z-index: 1;
}

.kk-auth-close:hover {
  color: #333;
}

/* Modal Title */
#kk-auth-title {
  text-align: center;
  padding: 25px 20px 10px;
  margin: 0;
  font-size: 24px;
  color: #333;
}

/* Tabs */
.kk-auth-tabs {
  display: flex;
  border-bottom: 2px solid #eee;
  padding: 0 20px;
}

.kk-tab-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 15px;
  font-size: 16px;
  cursor: pointer;
  color: #666;
  transition: all 0.2s;
  position: relative;
}

.kk-tab-btn:hover {
  color: #007cba;
}

.kk-tab-btn.active {
  color: #007cba;
}

.kk-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: #007cba;
}

/* Tab Content */
.kk-auth-tab {
  display: none;
  padding: 20px;
}

.kk-auth-tab.active {
  display: block;
  animation: tabFadeIn 0.3s ease;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Forms */
.kk-auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.kk-auth-form input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.kk-auth-form input:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 1px #007cba;
}

.kk-auth-form input:disabled {
  background-color: #f5f5f5;
  cursor: not-allowed;
}

/* Submit Button */
.kk-submit-btn {
  background: #007cba;
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.kk-submit-btn:hover {
  background: #005a87;
}

.kk-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Captcha */
.kk-captcha {
  background: #f9f9f9;
  padding: 12px;
  border-radius: 4px;
  border: 1px solid #eee;
}

.kk-captcha label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

.kk-captcha input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

/* Message Display */
.kk-auth-message {
  margin: 0 20px 20px;
  padding: 12px 15px;
  border-radius: 4px;
  display: none;
  font-size: 14px;
}

.kk-auth-message.success {
  display: block;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.kk-auth-message.error {
  display: block;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.kk-auth-message.info {
  display: block;
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Profile Form */
.kk-profile-form {
  max-width: 600px;
  margin: 20px auto;
  padding: 25px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.kk-profile-form h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

.kk-profile-field {
  margin-bottom: 20px;
}

.kk-profile-field label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #555;
}

.kk-profile-field input,
.kk-profile-field select,
.kk-profile-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.kk-profile-field input:focus,
.kk-profile-field select:focus,
.kk-profile-field textarea:focus {
  outline: none;
  border-color: #007cba;
}

.kk-profile-field input:disabled {
  background: #f5f5f5;
  cursor: not-allowed;
}

.kk-profile-field textarea {
  resize: vertical;
  min-height: 100px;
}

.kk-profile-field small {
  display: block;
  margin-top: 5px;
  color: #666;
  font-size: 12px;
}

.kk-profile-save {
  background: #007cba;
  color: #fff;
  border: none;
  padding: 12px 25px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.kk-profile-save:hover {
  background: #005a87;
}

.kk-success {
  background: #d4edda;
  color: #155724;
  padding: 12px;
  border-radius: 4px;
  margin-bottom: 20px;
  border: 1px solid #c3e6cb;
}

/* Navigation Menu Styles */
.kk-nav-profile-wrap {
  position: relative;
  display: inline-block;
}

.kk-nav-profile {
  cursor: pointer;
}

.kk-profile-submenu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  min-width: 120px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  z-index: 1000;
}

.kk-nav-profile-wrap:hover .kk-profile-submenu {
  display: block;
}

.kk-profile-submenu a {
  display: block;
  padding: 8px 15px;
  color: #333;
  text-decoration: none;
  transition: background 0.2s;
}

.kk-profile-submenu a:hover {
  background: #f5f5f5;
}

.kk-nav-login,
.kk-auth-trigger {
  cursor: pointer;
}

/* Auth Button */
.kk-auth-trigger {
  background: #007cba;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.kk-auth-trigger:hover {
  background: #005a87;
}

/* Profile Button */
.kk-profile-btn {
  display: inline-block;
  background: #007cba;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}

.kk-profile-btn:hover {
  background: #005a87;
  color: #fff;
  text-decoration: none;
}

/* Body modal open state */
body.kk-modal-open {
  overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
  .kk-auth-modal {
    width: 95%;
    margin: 20px auto;
  }

  .kk-tab-btn {
    font-size: 14px;
    padding: 10px;
  }

  .kk-auth-form input,
  .kk-submit-btn {
    padding: 10px 12px;
  }

  .kk-profile-form {
    padding: 15px;
    margin: 10px;
  }
}

@media (max-width: 480px) {
  .kk-auth-tabs {
    padding: 0 10px;
  }

  .kk-tab-btn {
    font-size: 12px;
    padding: 8px;
  }

  #kk-auth-title {
    font-size: 20px;
    padding: 20px 15px 10px;
  }

  .kk-auth-tab {
    padding: 15px;
  }
}

/* Loading State */
.kk-submit-btn.loading {
  position: relative;
  color: transparent;
}

.kk-submit-btn.loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Field Validation Styles */
.kk-auth-form input.error,
.kk-profile-field input.error {
  border-color: #dc3545;
}

.kk-auth-form input.valid,
.kk-profile-field input.valid {
  border-color: #28a745;
}

/* Tooltip for validation */
.kk-error-tooltip {
  position: absolute;
  background: #dc3545;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-top: 2px;
  z-index: 1000;
}

.kk-error-tooltip::before {
  content: "";
  position: absolute;
  top: -4px;
  left: 10px;
  border-width: 0 4px 4px;
  border-style: solid;
  border-color: transparent transparent #dc3545;
}

.login-button-container {
  margin: 15px;
}
