/**
 * account.css
 *
 * Purpose: Account page styles, Settings page styles, welcome screen,
 * sign-in modal, and edit username modal styles.
 *
 * Dependencies: base.css
 *
 * Key Styles:
 * - Account page layout
 * - Account card rows
 * - Settings page layout
 * - Settings card rows
 * - Welcome overlay and form
 * - Sign-in modal
 * - Edit username modal
 * - Form inputs and buttons
 */

/* ==================== ACCOUNT PAGE ==================== */

.account-page {
  display: none;
}

.account-page.active {
  display: block;
}

.account-container {
  max-width: 600px;
  margin: 0 auto;
}

.account-title {
  font-size: 2.5em;
  color: #667eea;
  padding-top: 24px;
  margin-bottom: 30px;
  text-align: center;
  font-weight: 800;
}

.account-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  border: 1px solid #e0e0e0;
}

.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #e0e0e0;
}

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

.account-row-label {
  font-size: 1.1em;
  color: #666;
  font-weight: 600;
}

.account-row-value {
  font-size: 1.3em;
  color: #667eea;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.edit-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8em;
  padding: 5px;
  transition: opacity 0.3s;
}

.edit-icon-btn:hover {
  opacity: 0.7;
}

/* ==================== WELCOME SCREEN ==================== */

.welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.welcome-overlay.active {
  display: flex;
}

.welcome-card {
  background: white;
  border-radius: 20px;
  padding: 50px 40px;
  max-width: 500px;
  width: 100%;
  min-height: 90vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: welcomeSlideIn 0.5s ease-out;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.welcome-title {
  font-size: 2.5em;
  color: #667eea;
  margin-bottom: 15px;
  font-weight: 800;
}

.welcome-subtitle {
  font-size: 1.3em;
  color: #4a4a8a;
  margin-bottom: 25px;
  font-weight: 600;
}

.welcome-instructions {
  font-size: 0.95em;
  color: #888888;
  line-height: 1.6;
  margin-bottom: 35px;
  padding: 0 10px;
  font-weight: 400;
}

.welcome-input-group {
  margin-bottom: 30px;
  position: relative;
}

.welcome-input {
  width: 100%;
  padding: 12px 18px;
  font-size: 1.1em;
  border: 2px solid #d0d0d0;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.3s;
  box-sizing: border-box;
  background: white;
}

.welcome-input:focus {
  border-color: #667eea;
}

.welcome-input.invalid {
  border-color: #e74c3c;
}

.welcome-input.valid {
  border-color: #27ae60;
}

.welcome-error {
  color: #e74c3c;
  font-size: 0.9em;
  margin-top: 8px;
  min-height: 20px;
}

.welcome-start-btn {
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  border: none;
  padding: 15px 40px;
  font-size: 1.2em;
  border-radius: 10px;
  cursor: pointer;
  transition:
    transform 0.3s,
    opacity 0.3s;
  font-weight: 700;
  font-family: "Nunito", sans-serif;
}

.welcome-start-btn:hover:not(:disabled) {
  transform: scale(1.02);
}

.welcome-start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.welcome-divider {
  margin: 25px 0;
  color: #999;
  font-size: 0.9em;
  text-align: center;
  letter-spacing: 2px;
}

.welcome-signin-text {
  font-size: 0.95em;
  color: #666;
  margin-bottom: 10px;
  text-align: center;
}

.welcome-signin-link {
  background: none;
  border: none;
  color: #667eea;
  font-size: 1em;
  cursor: pointer;
  text-decoration: underline;
  transition: opacity 0.3s;
  padding: 5px;
  font-family: "Nunito", sans-serif;
  font-weight: 600;
}

.welcome-signin-link:hover {
  opacity: 0.7;
}

/* ==================== SIGN IN MODAL ==================== */

.signin-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2002;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.signin-modal.active {
  display: flex;
}

.signin-modal-content {
  background: white;
  border-radius: 15px;
  padding: 30px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.signin-modal-title {
  font-size: 1.5em;
  color: #667eea;
  margin-bottom: 10px;
  text-align: center;
  font-weight: 700;
}

.signin-modal-subtitle {
  font-size: 0.95em;
  color: #888;
  margin-bottom: 20px;
  text-align: center;
}

.signin-modal-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.signin-modal-buttons button {
  flex: 1;
  padding: 12px 20px;
  font-size: 1em;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: transform 0.3s;
  font-family: "Nunito", sans-serif;
  font-weight: 600;
}

.signin-modal-buttons button:hover:not(:disabled) {
  transform: scale(1.02);
}

.signin-cancel-link {
  background: none;
  border: none;
  color: #999;
  font-size: 0.9em;
  cursor: pointer;
  margin-top: 15px;
  text-align: center;
  width: 100%;
  padding: 5px;
  transition: opacity 0.3s;
  font-family: "Nunito", sans-serif;
}

.signin-cancel-link:hover {
  opacity: 0.7;
  text-decoration: underline;
}

/* ==================== EDIT USERNAME MODAL ==================== */

.edit-username-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  transition: opacity 0.3s;
  font-size: 0.8em;
}

.edit-username-btn:hover {
  opacity: 0.7;
}

.edit-username-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2001;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.edit-username-modal.active {
  display: flex;
}

.edit-username-content {
  background: white;
  border-radius: 15px;
  padding: 30px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.edit-username-title {
  font-size: 1.5em;
  color: #667eea;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
}

.edit-username-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.edit-username-buttons button {
  flex: 1;
  padding: 12px 20px;
  font-size: 1em;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: transform 0.3s;
}

.edit-username-buttons button:hover {
  transform: scale(1.02);
}

.cancel-btn {
  background: #e0e0e0;
  color: #666;
}

.save-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==================== SIGN OUT BUTTON ==================== */

.sign-out-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.1em;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s, opacity 0.3s;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
}

.sign-out-btn:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

.sign-out-note {
  font-size: 0.85em;
  color: #888;
  line-height: 1.5;
  margin: 0;
  text-align: center;
}

/* ==================== SIGN OUT MODAL ==================== */

.signout-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2003;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.signout-modal.active {
  display: flex;
}

.signout-modal-content {
  background: white;
  border-radius: 15px;
  padding: 30px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.signout-modal-title {
  font-size: 1.5em;
  color: #e74c3c;
  margin-bottom: 15px;
  text-align: center;
  font-weight: 700;
}

.signout-modal-subtitle {
  font-size: 0.95em;
  color: #666;
  margin-bottom: 25px;
  text-align: center;
  line-height: 1.5;
}

.signout-modal-buttons {
  display: flex;
  gap: 12px;
}

.signout-cancel-btn {
  flex: 1;
  padding: 14px 20px;
  font-size: 1em;
  background: #e0e0e0;
  color: #666;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s;
  font-family: "Nunito", sans-serif;
  font-weight: 600;
}

.signout-cancel-btn:hover {
  transform: scale(1.02);
}

.signout-confirm-btn {
  flex: 1;
  padding: 14px 20px;
  font-size: 1em;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s, opacity 0.3s;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
}

.signout-confirm-btn:hover {
  transform: scale(1.02);
  opacity: 0.9;
}

/* ==================== SETTINGS PAGE ==================== */

.settings-page {
  display: none;
}

.settings-page.active {
  display: block;
}

.settings-container {
  max-width: 600px;
  margin: 0 auto;
}

.settings-title {
  font-size: 2.5em;
  color: #667eea;
  padding-top: 24px;
  margin-bottom: 30px;
  text-align: center;
  font-weight: 800;
}

.settings-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 15px;
  border: 1px solid #e0e0e0;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #e0e0e0;
}

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

.settings-row-label {
  font-size: 1.1em;
  color: #666;
  font-weight: 600;
}

.settings-row-value {
  font-size: 1.3em;
  color: #667eea;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==================== RESPONSIVE - WELCOME CARD ==================== */

@media (max-width: 480px) {
  .welcome-card {
    padding: 30px 20px;
    min-height: 90vh;
  }

  .welcome-title {
    font-size: 1.8em;
  }

  .welcome-subtitle {
    font-size: 0.95em;
  }

  .welcome-instructions {
    font-size: 0.9em;
  }

  .settings-title {
    font-size: 2em;
  }
}

/* ==================== MILESTONE CELEBRATION MODAL ==================== */

.milestone-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(102, 126, 234, 0.95);
  z-index: 2004;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.milestone-modal.active {
  display: flex;
}

.milestone-modal-content {
  background: white;
  border-radius: 20px;
  padding: 30px 25px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: modalSlideIn 0.4s ease-out;
  text-align: center;
}

/* Header Section */
.milestone-modal-header {
  margin-bottom: 15px;
}

.milestone-modal-title {
  font-size: 1.8em;
  color: #667eea;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.2;
}

.milestone-modal-title.game-complete {
  font-size: 1.6em;
  background: linear-gradient(135deg, #f39c12 0%, #e74c3c 50%, #9b59b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.milestone-modal-subtitle {
  font-size: 1.15em;
  color: #666;
  font-weight: 600;
}

/* Divider */
.milestone-modal-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
  margin: 15px 0;
}

/* Stats Section */
.milestone-modal-stats {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 15px 20px;
  margin-bottom: 5px;
}

.milestone-stat-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 0;
  gap: 12px;
}

.milestone-stat-row:not(:last-child) {
  border-bottom: 1px solid #e8e8e8;
}

.milestone-stat-icon {
  font-size: 1.1em;
  width: 24px;
  text-align: center;
}

.milestone-stat-value {
  font-size: 1em;
  color: #555;
  font-weight: 600;
}

/* Support Section */
.milestone-modal-support {
  margin: 15px 0;
  padding: 15px;
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border-radius: 12px;
  border: 1px solid #ffd54f;
}

.milestone-support-text {
  font-size: 0.95em;
  color: #666;
  margin-bottom: 12px;
  font-weight: 500;
}

.milestone-coffee-btn {
  display: inline-block;
  background: linear-gradient(135deg, #ff813f 0%, #ff5f00 100%);
  color: white;
  text-decoration: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 0.95em;
  font-weight: 700;
  font-family: "Nunito", sans-serif;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(255, 95, 0, 0.3);
}

.milestone-coffee-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(255, 95, 0, 0.4);
}

.milestone-coffee-btn:active {
  transform: scale(0.98);
}

/* Actions Section */
.milestone-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.milestone-share-btn {
  width: 100%;
  padding: 12px 20px;
  font-size: 1em;
  background: #f0f0f0;
  color: #555;
  border: 1px solid #ddd;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  font-family: "Nunito", sans-serif;
  font-weight: 600;
}

.milestone-share-btn:hover {
  background: #e8e8e8;
  transform: scale(1.01);
}

.milestone-share-btn:active {
  transform: scale(0.98);
}

.milestone-continue-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 1.1em;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.milestone-continue-btn:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.milestone-continue-btn:active {
  transform: scale(0.98);
}

/* Share Feedback Message */
.milestone-share-feedback {
  margin-top: 10px;
  font-size: 0.9em;
  color: #27ae60;
  font-weight: 600;
  min-height: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.milestone-share-feedback.visible {
  opacity: 1;
}

/* ==================== MILESTONE POPUP CLOSE BUTTON ==================== */
/* Styled similar to hamburger menu but sized appropriately for popup */

.milestone-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  font-size: 1.4em;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.3s,
    transform 0.2s;
  padding: 0;
  line-height: 1;
  z-index: 1;
}

.milestone-popup-close:hover {
  opacity: 0.7;
  transform: rotate(90deg);
}

.milestone-popup-close:active {
  opacity: 0.5;
}

/* Make modal content relative for absolute positioned close button */
.milestone-modal-content {
  position: relative;
}

/* ==================== LOCKED MILESTONE POPUP ==================== */

.locked-milestone-content {
  text-align: center;
  padding: 10px 0;
}

.locked-milestone-icon {
  font-size: 3em;
  margin-bottom: 15px;
}

.locked-milestone-title {
  font-size: 1.5em;
  color: #667eea;
  font-weight: 800;
  margin-bottom: 20px;
}

.locked-milestone-requirement {
  font-size: 1.1em;
  color: #666;
  font-weight: 600;
  margin-bottom: 12px;
}

.locked-milestone-progress {
  font-size: 1em;
  color: #888;
  margin-bottom: 20px;
}

.locked-milestone-motivation {
  font-size: 1.1em;
  color: #667eea;
  font-weight: 700;
  margin-bottom: 25px;
}

/* Responsive Adjustments */
@media (max-width: 400px) {
  .milestone-modal-content {
    padding: 25px 20px;
    max-width: 340px;
  }

  .milestone-modal-title {
    font-size: 1.5em;
  }

  .milestone-modal-subtitle {
    font-size: 1em;
  }

  .milestone-stat-value {
    font-size: 0.95em;
  }

  .milestone-coffee-btn {
    padding: 9px 20px;
    font-size: 0.9em;
  }

  .milestone-continue-btn {
    padding: 12px 18px;
    font-size: 1em;
  }
}

@media (max-width: 320px) {
  .milestone-modal {
    padding: 15px;
  }

  .milestone-modal-content {
    padding: 20px 15px;
    max-width: 300px;
  }

  .milestone-modal-title {
    font-size: 1.3em;
  }

  .milestone-modal-stats {
    padding: 12px 15px;
  }
}

/* ==================== SOCIAL SHARING ICONS ==================== */

.milestone-share-section {
  margin: 15px 0;
}

.milestone-share-label {
  font-size: 0.95em;
  color: #666;
  margin-bottom: 12px;
  font-weight: 600;
  text-align: center;
}

.social-share-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 0 auto;
}

.social-icon-btn {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 28px;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  padding: 0;
  background-color: transparent;
}

/* Ensure Font Awesome icons inherit color from parent */
.social-icon-btn i {
  color: inherit;
}

/* Style for social logo images */
.social-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.social-icon-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.social-icon-btn:active {
  transform: scale(0.95);
}

.social-icon-btn:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Instagram - Official gradient background with Font Awesome icon */
.icon-instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: white;
}

.icon-instagram:hover {
  box-shadow: 0 4px 12px rgba(220, 39, 67, 0.4);
}

/* WhatsApp - Official green background with Font Awesome icon */
.icon-whatsapp {
  background-color: #25D366;
  color: white;
}

.icon-whatsapp:hover {
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

/* Telegram - Logo contains brand color */
.icon-telegram:hover {
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4);
}

/* Snapchat - Logo contains brand yellow */
.icon-snapchat:hover {
  box-shadow: 0 4px 12px rgba(255, 252, 0, 0.5);
}

/* Copy - Grey background */
.icon-copy {
  background-color: #E5E7EB;
}

.icon-copy:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments for social icons */
@media (max-width: 400px) {
  .social-share-container {
    gap: 10px;
  }

  .social-icon-btn {
    width: 50px;
    height: 50px;
    font-size: 25px;
  }

  .milestone-share-label {
    font-size: 0.9em;
  }
}

@media (max-width: 320px) {
  .social-share-container {
    gap: 8px;
  }

  .social-icon-btn {
    width: 46px;
    height: 46px;
    font-size: 23px;
  }

  .milestone-share-label {
    font-size: 0.85em;
  }
}
