/* 
==========================================
  VARIABLES AND RESET
==========================================
*/

:root {
  /* Colors - Dark Theme (Default) */
  --bg-primary: #02090D;
  --bg-secondary: rgba(183.60, 207.20, 224.40, 0.12);
  --text-primary: #D7DFE4;
  --text-secondary: rgba(208.59, 223.93, 235.11, 0.62);
  --text-placeholder: rgba(208.59, 223.93, 235.11, 0.40);
  --accent-color: #0D99FF;
  --social-bg: #828E97; /* Updated to match login page */
  --input-bg: rgba(183.60, 207.20, 224.40, 0.12); /* Updated to match login page */
  --border-color: rgba(255, 255, 255, 0); /* Updated to match login page */
  --error-color: #ff4d4d;
  --success-color: #27ae60;

  /* Colors - Light Theme */
  --bg-primary-light: #FBFDFE;
  --bg-secondary-light: #F5F5F5;
  --text-primary-light: #02090D;
  --text-secondary-light: #656565;
  --text-placeholder-light: #9CA3AF;
  --social-bg-light: #ECECEC;
  --input-bg-light: #F9FAFB; /* Updated to match login page */

  /* Typography */
  --font-family: 'Public Sans', sans-serif;
  --font-size-small: 13px;
  --font-size-regular: 15px;
  --font-size-large: 28px;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --line-height-small: 16px;
  --line-height-regular: 20px;
  --line-height-large: 32px;

  /* Spacing */
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;

  /* Radius */
  --border-radius: 8px;
  --uni-card-radius: 43px;
  
  /* Transition */
  --theme-transition-duration: 300ms;
  --transition-quick: 0.3s ease;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Theme transition class - applied during theme changes */
html.theme-transition,
html.theme-transition *,
html.theme-transition *:before,
html.theme-transition *:after {
  transition: all var(--theme-transition-duration) ease !important;
  transition-delay: 0 !important;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 
==========================================
LIGHT THEME STYLES
==========================================
*/

body.light-theme {
  background-color: var(--bg-primary-light);
  color: var(--text-primary-light);
}

.light-theme .header {
  background-color: var(--bg-primary-light);
}

.light-theme .dark-icon {
  display: none;
}

.light-theme .light-icon {
  display: block;
  color: var(--text-primary-light); /* This makes the sun icon dark in light mode */
}

.light-theme .signup-form input,
.light-theme .signup-form select {
  background-color: var(--input-bg-light);
  color: var(--text-primary-light);
  border-color: rgba(52, 152, 219, 0.3);
}

.light-theme .signup-form input::placeholder {
  color: var(--text-placeholder-light);
}

.light-theme .social-icon {
  background-color: var(--social-bg-light);
  color: black; /* Updated to match login page */
}

.light-theme .signup-btn {
  color: #F9F9F9;
}

.light-theme .forgot-link,
.light-theme .trouble-link,
.light-theme label {
  color: var(--text-primary-light);
}

.light-theme .carousel-arrow {
  color: var(--text-primary-light);
}

.light-theme .university-card {
  background-color: var(--bg-secondary-light);
}

/* 
==========================================
LAYOUT & CONTAINER STYLES
==========================================
*/

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  height: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  background-color: var(--bg-primary);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px 0px 30px 0px;
}

.footer {
  padding: 0px 0px 70px 0px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* 
==========================================
LOGO & THEME TOGGLE
==========================================
*/

.logo {
  width: 29px; /* Updated to match login page */
  height: 36px; /* Updated to match login page */
  display: flex;
  align-items: center;
}

.logo-img {
  width: 100%;
  height: auto;
}

.logo a {
  display: contents;
}

.theme-toggle {
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-primary);
  font-size: 22px;
}

.dark-icon {
  display: block;
}

.light-icon {
  display: none;
}

/* 
==========================================
UNIVERSITY SELECTION STYLES
==========================================
*/

.signup-step {
  width: 100%;
  max-width: 800px;
  display: none;
}

.active-step {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Main carousel container */
.university-carousel {
  width: 100%;
  max-width: 750px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 50px 0 30px;
  position: relative;
  overflow: hidden;
  background: var(--bg-primary);
}

.light-theme .university-carousel {
  background: var(--bg-primary-light);
}

/* Slider window - horizontal scroll container */
.university-slider {
  width: 100%;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 20px 0;
  /* Hide scrollbar but keep functionality */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  /* Smooth scrolling - disabled for infinite loop */
  scroll-behavior: auto;
  /* Enable momentum scrolling on iOS */
  -webkit-overflow-scrolling: touch;
  /* Ensure content is isolated from pseudo-elements */
  isolation: isolate;
  /* Match parent background */
  background: var(--bg-primary);
}

.light-theme .university-slider {
  background: var(--bg-primary-light);
}

/* Hide scrollbar for Chrome, Safari */
.university-slider::-webkit-scrollbar {
  display: none;
}

/* Container for all cards */
.university-slide-container {
  display: flex;
  gap: 24px;
  /* Remove padding for infinite scroll - we have enough duplicate sets */
  padding-left: 0;
  padding-right: 0;
  /* Scroll snap - disabled for infinite loop */
  scroll-snap-type: none;
  /* Prevent white background showing */
  background: var(--bg-primary);
}

.light-theme .university-slide-container {
  background: var(--bg-primary-light);
}

/* Individual university card */
.university-card {
  width: 180px;
  height: 180px;
  flex: 0 0 180px;
  background-color: rgb(222, 222, 222);
  border-radius: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
  padding: 20px;
  /* Scroll snap - disabled for infinite loop */
  scroll-snap-align: none;
  position: relative;
  z-index: 1; /* Below the shades */
  /* Prevent any white background bleeding */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  user-select: none; /* Prevent text selection during drag */
}

/* Hover effect for cards */
.university-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Selected card style */
.university-card.selected {
  border: 3px solid var(--accent-color);
  box-shadow: 0 0 0 4px rgba(13, 153, 255, 0.15);
}

/* University logo within card */
.university-logo {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

/* Remove dynamic scroll indicators - using only fixed carousel shades */

/* Hide arrows - keeping CSS for backward compatibility but hiding */
.carousel-arrow {
  display: none;
}

/* Light theme adjustments */
.light-theme .university-card {
  background-color: var(--bg-secondary-light);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.light-theme .university-card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}


/* 
==========================================
SIGNUP FORM STYLES
==========================================
*/

.signup-header {
  text-align: center;
  margin-bottom: 15px; /* Updated to match login page */
}

.signup-header h1 {
  font-size: var(--font-size-large);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-large);
  margin-bottom: 8px;
}

.signup-header p {
  font-size: var(--font-size-regular);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-regular);
  color: var(--text-secondary);
}

.light-theme .signup-header p {
  color: var(--text-secondary-light);
}

.signup-form {
  width: 100%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  gap: 28px; /* Updated to match login page */
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: var(--font-size-regular);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-regular);
  color: var(--text-primary);
}

.signup-form input,
.signup-form select {
  width: 100%;
  height: 41px; /* Updated to match login page */
  padding: 8px 12px; /* Updated to match login page */
  background-color: var(--input-bg);
  border: 1.5px solid rgba(52, 152, 219, 0.3); /* Updated to match login page */
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: var(--font-size-regular);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-regular);
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.signup-form input:focus,
.signup-form select:focus {
  border-color: rgba(52, 152, 219, 0.8);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.light-theme .signup-form input,
.light-theme .signup-form select {
  border-color: rgba(52, 152, 219, 0.3);
}

.light-theme .signup-form input:focus,
.light-theme .signup-form select:focus {
  border-color: rgba(52, 152, 219, 0.8);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* Password field with toggle */
.password-field {
  position: relative;
  width: 100%;
}

.password-toggle {
  position: absolute;
  right: 12px; /* Updated to match login page */
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle i {
  font-size: 18px;
}

.password-toggle:hover {
  color: var(--text-primary);
}

.light-theme .password-toggle {
  color: var(--text-secondary-light);
}

.light-theme .password-toggle:hover {
  color: var(--text-primary-light);
}

.signup-form input::placeholder {
  color: var(--text-placeholder);
}

.signup-btn {
  width: 100%;
  padding: 8px 16px; /* Updated to match login page */
  background-color: var(--accent-color);
  border: none;
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: var(--font-size-regular);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-regular);
  cursor: pointer;
  text-align: center;
  transition: background-color 0.3s ease;
  margin-top: 0; /* Updated to match login page */
  height: auto; /* Updated to match login page */
}

.signup-btn:hover {
  background-color: #0b87e0;
}

/* 
==========================================
ENHANCED PASSWORD VALIDATION STYLES
==========================================
*/

/* Password strength indicator */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: rgba(183, 207, 224, 0.12);
    border-radius: 2px;
    overflow: hidden;
    transition: all var(--transition-quick);
    position: relative;
    z-index: 0;
}

[data-theme="light"] .password-strength {
    background: #EDEDED;
}

.password-strength-bar {
    height: 100%;
    transition: width 0.4s ease, background-color 0.3s ease;
    border-radius: 2px;
}

.password-strength.weak .password-strength-bar {
    width: 25%;
    background: #e74c3c;
}

.password-strength.fair .password-strength-bar {
    width: 50%;
    background: #f39c12;
}

.password-strength.good .password-strength-bar {
    width: 75%;
    background: #3498db;
}

.password-strength.strong .password-strength-bar {
    width: 100%;
    background: #27ae60;
}

/* Password requirements - always visible when typing */
.password-requirements {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    position: relative;
    z-index: 0;
}

.password-requirements ul {
    margin: 4px 0 0 16px;
    padding: 0;
    list-style: none;
}

.password-requirements li {
    margin-bottom: 2px;
    transition: color var(--transition-quick);
    display: flex;
    align-items: center;
}

.password-requirements li i {
    margin-right: 8px;
    font-size: 14px;
    transition: color 0.3s ease;
}

.password-requirements li.valid {
    color: #27ae60;
}

.password-requirements li.valid i {
    color: #27ae60;
}

.password-requirements li.invalid {
    color: #e74c3c;
}

.password-requirements li.invalid i {
    color: #e74c3c;
}

/* Form validation states */
.form-group input.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group input.success {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1);
}

.form-group input.success:focus {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.2);
}

/* Light theme success state */
.light-theme .form-group input.success {
    border-color: #27ae60;
}

/* Error messages with enhanced animation */
.error-message {
    margin-top: 8px;
    color: #e74c3c;
    font-size: 0.875rem;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Success messages */
.success-message {
    margin-top: 4px;
    color: #27ae60;
    font-size: 0.875rem;
}

/* Ensure password extras are positioned correctly */
.password-field + .password-strength,
.password-field + .password-requirements {
    clear: both;
    width: 100%;
}

/* For when both strength and requirements are present */
.password-strength + .password-requirements {
    margin-top: 4px;
}

/* Loading button states */
.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 
==========================================
ACCOUNT LINKS STYLES
==========================================
*/

.account-links {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0 0px 0;
}

.light-theme .login-link,
.light-theme .trouble-link {
  color: var(--text-primary-light);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-small);
  text-decoration: none;
}

.login-link,
.trouble-link {
  color: var(--text-primary);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-small);
  text-decoration: none;
}

.trouble-link {
  margin-bottom: 16px;
  color: var(--text-primary);
}

.login-link:hover,
.trouble-link:hover {
  color: var(--accent-color);
}

/* 
==========================================
SOCIAL ICONS STYLES
==========================================
*/

.social-icons {
  display: flex;
  gap: 16px;
  margin-top: 0;
}

.social-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.light-theme .social-icon {
  background: rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-primary-light);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.social-icon:hover {
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(15px);
}

.light-theme .social-icon:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.social-icon i {
  font-size: 18px;
}

/* Platform-specific hover styles */
.social-icon[aria-label*="Telegram"]:hover {
  background-color: #1c86c9 !important; 
  color: #ffffff !important;
  transition: all 0.4s var(--ease-out-expo);
}

.social-icon[aria-label*="Instagram"]:hover {
  background: linear-gradient(45deg, #f09433 0%,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888 100%) !important; 
  color: #ffffff !important;
  transition: all 0.4s var(--ease-out-expo);
}

.social-icon[aria-label*="Discord"]:hover {
  background-color: #5865F2 !important; 
  color: #ffffff !important;
  transition: all 0.4s var(--ease-out-expo);
}

.social-icon[aria-label*="Twitter"]:hover {
  background-color: #000000 !important; 
  color: #ffffff !important;
  transition: all 0.4s var(--ease-out-expo);
}

/* 
==========================================
MESSAGES STYLES
==========================================
*/

.messages {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: 80%;
  max-width: 500px;
}

.alert {
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: var(--border-radius);
  font-size: var(--font-size-regular);
  text-align: center;
}

.alert-error {
  background-color: var(--error-color);
  color: white;
}

.alert-success {
  background-color: #4CAF50;
  color: white;
}

.alert-warning {
  background-color: #ff9800;
  color: white;
}

.alert-info {
  background-color: var(--accent-color);
  color: white;
}

/* 
==========================================
RESPONSIVE STYLES
==========================================
*/

/* Mobile responsiveness for password validation */
@media (max-width: 768px) {
    .password-requirements {
        font-size: 11px;
    }
    
    .password-requirements li i {
        font-size: 12px;
        margin-right: 6px;
    }
    
    .password-strength {
        height: 3px;
    }
    
    .error-message,
    .success-message {
        font-size: 0.8rem;
    }
}

@media screen and (max-width: 768px) {
  .container {
    padding: 0 24px;
  }

  .signup-step {
    max-width: 100%;
  }

  .university-carousel {
    overflow: hidden;
  }

  .university-slider {
    width: 100%;
    padding: 15px 0;
  }

  .university-card {
    width: 130px;
    height: 130px;
    flex: 0 0 130px;
    border-radius: 20px;
    padding: 12px;
  }

  .university-slide-container {
    gap: 16px;
    padding-left: 0;
    padding-right: 0;
  }

  .signup-form {
    max-width: 100%;
    gap: 32px; /* Better spacing */
  }

  /* Enhanced touch targets for mobile */
  .signup-form input,
  .signup-form select {
    height: 48px; 
    font-size: 16px; 
    padding: 12px 16px;
  }

  .signup-btn {
    min-height: 48px;
    font-size: 16px;
    padding: 12px 16px;
  }

  /* Social icons touch optimization */
  .social-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  /* Better form group spacing */
  .form-group {
    gap: 12px;
  }

  .main-content {
    padding: 24px 0;
  }
}

@media screen and (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .signup-header h1 {
    font-size: 24px;
  }

  .signup-header p {
    font-size: 14px;
  }

  /* Specific mobile adjustments for the carousel */
  .university-carousel {
    margin: 40px 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .university-slider {
    width: 100%;
    padding: 10px 0;
  }

  .university-card {
    width: 110px;
    height: 110px;
    flex: 0 0 110px;
    border-radius: 18px;
    padding: 10px;
  }

  .university-slide-container {
    gap: 12px;
    padding-left: 0;
    padding-right: 0;
  }

  /* Enhanced mobile form spacing */
  .signup-form {
    gap: 28px;
  }

  .social-icons {
    gap: 12px;
  }

  /* Footer improvements */
  .footer {
    padding: 0 0 40px 0;
    gap: 20px;
    margin-top: 10px;
  }
}

/* Landscape mobile orientation */
@media screen and (max-height: 600px) and (orientation: landscape) {
  .main-content {
    padding: 16px 0;
  }

  .university-carousel {
    margin: 20px 0;
  }

  .university-card {
    height: 180px;
  }
}