/* =============================================
   AMITA Profile Setup Page CSS - Updated
   ============================================= */

/* CSS Variables */
:root {
  --primary-dark: #142320;
  --primary-medium: #2D4A44;
  --primary-light: #1A2E2A;
  --accent-green: #93D5B8;
  --accent-green-light: #A8E6CE;
  --accent-green-dark: #7BC4A3;
  --white: #FFFFFF;
  --off-white: #E8F1EF;
  --gray-light: #F5F5F5;
  --gray-medium: #666666;
  --border-color: rgba(147, 213, 184, 0.2);
  --text-primary: #E8F1EF;
  --text-secondary: rgba(232, 241, 239, 0.7);
  --text-muted: rgba(232, 241, 239, 0.5);
  --error: #F97066;
  --warning: #FDB022;
  --success: #7BC4A3;
}

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

/* Hidden Elements */
.skip-link {
  display: none !important;
}

/* Body */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #0E1F1C 0%, #142320 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Navigation Bar */
.navbar {
  background: rgba(20, 35, 32, 0.95);
  backdrop-filter: saturate(120%) blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Logo - Fixed at 40px */
.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.logo-container:hover {
  transform: translateY(-1px);
}

.logo {
  width: 40px !important;
  height: 40px !important;
  border-radius: 8px;
  object-fit: contain;
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-green);
  letter-spacing: 0.5px;
}

/* Navigation Menu */
.nav-menu {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-menu a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent-green);
  transform: translateX(-50%);
  transition: width 0.2s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 80%;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--accent-green);
  background: rgba(147, 213, 184, 0.05);
}

.nav-menu a.active {
  font-weight: 600;
}

/* Navigation Right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  background: transparent;
}

.btn:focus {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

.btn-outlined {
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  background: rgba(147, 213, 184, 0.05);
}

.btn-outlined:hover {
  background: rgba(147, 213, 184, 0.1);
  border-color: var(--accent-green);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--accent-green);
  background: rgba(147, 213, 184, 0.05);
  border-color: var(--border-color);
}

/* Page Header */
.page-header {
  padding: 100px 2rem 2rem;
  background: linear-gradient(160deg, #0F2A26, #142320);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.page-header .inner {
  max-width: 1200px;
  margin: 0 auto;
}

.page-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
  color: var(--accent-green);
}

.page-header p {
  opacity: 0.85;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Main Container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

/* Profile Form Wrapper - New Design */
.profile-form-wrapper {
  background: linear-gradient(135deg, rgba(20, 35, 32, 0.95), rgba(20, 35, 32, 0.9));
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

/* Form Header */
.form-header {
  text-align: center;
  padding: 40px 20px 30px;
  background: linear-gradient(135deg, rgba(147, 213, 184, 0.1), transparent);
  border-bottom: 1px solid rgba(147, 213, 184, 0.1);
}

.form-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  color: var(--accent-green);
  margin-bottom: 10px;
}

.form-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 600px;
  margin: 0 auto;
}

/* Profile Form */
.profile-form {
  padding: 0;
}

/* Avatar Section - Redesigned */
.avatar-section-wrapper {
  padding: 40px;
  background: linear-gradient(135deg, rgba(147, 213, 184, 0.05), transparent);
  border-bottom: 1px solid rgba(147, 213, 184, 0.1);
}

.avatar-container {
  display: flex;
  align-items: center;
  gap: 40px;
  max-width: 600px;
  margin: 0 auto;
}

.avatar-preview {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-medium), var(--primary-light));
  border: 4px solid var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: rgba(147, 213, 184, 0.6);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(147, 213, 184, 0.2);
  transition: all 0.3s ease;
  position: relative;
  flex-shrink: 0;
}

.avatar-preview::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--accent-green), var(--accent-green-dark));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.avatar-preview:hover {
  transform: scale(1.05);
  box-shadow: 0 16px 48px rgba(147, 213, 184, 0.3);
}

.avatar-preview:hover::after {
  opacity: 1;
}

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

.avatar-placeholder {
  font-size: 4rem;
  color: rgba(147, 213, 184, 0.6);
}

.avatar-upload {
  flex: 1;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, rgba(147, 213, 184, 0.15), rgba(147, 213, 184, 0.1));
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--accent-green);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 12px;
}

.btn-upload:hover {
  background: linear-gradient(135deg, rgba(147, 213, 184, 0.25), rgba(147, 213, 184, 0.15));
  border-color: var(--accent-green);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(147, 213, 184, 0.2);
}

.upload-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Form Fields Container */
.form-fields-container {
  padding: 40px;
}

/* Form Sections */
.form-section {
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(147, 213, 184, 0.1);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 20px;
  padding-bottom: 0;
}

.section-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-green);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--accent-green);
  border-radius: 2px;
}

/* Form Grid Layout */
.form-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.form-grid.two-col {
  grid-template-columns: 1fr 1fr;
}

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

.form-group.full-width {
  grid-column: 1 / -1;
}

/* Form Labels */
.form-label {
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--accent-green);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.required {
  color: var(--error);
  margin-left: 2px;
}

/* Form Inputs */
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 16px;
  background: rgba(20, 35, 32, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393D5B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1.2em;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-green);
  background: rgba(20, 35, 32, 0.6);
  box-shadow: 0 0 0 3px rgba(147, 213, 184, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  line-height: 1.5;
}

/* Character Count */
.char-count {
  text-align: right;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

/* Skills Section - Enhanced */
.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  min-height: 60px;
  padding: 16px;
  background: rgba(147, 213, 184, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  position: relative;
}

.skills-tags:empty::after {
  content: 'Your skills will appear here as you add them';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, rgba(147, 213, 184, 0.2), rgba(147, 213, 184, 0.1));
  border: 1px solid rgba(147, 213, 184, 0.4);
  border-radius: 25px;
  color: var(--accent-green);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.skill-tag::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(147, 213, 184, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.skill-tag:hover::before {
  width: 100px;
  height: 100px;
}

.skill-tag:hover {
  background: linear-gradient(135deg, rgba(147, 213, 184, 0.3), rgba(147, 213, 184, 0.15));
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(147, 213, 184, 0.25);
}

.skill-tag button {
  background: none;
  border: none;
  color: var(--accent-green);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: all 0.2s ease;
  z-index: 1;
}

.skill-tag button:hover {
  opacity: 1;
  color: var(--error);
  transform: scale(1.2);
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 40px;
  background: linear-gradient(135deg, rgba(147, 213, 184, 0.05), transparent);
  border-top: 1px solid rgba(147, 213, 184, 0.1);
  gap: 20px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-green), var(--accent-green-dark));
  color: var(--primary-dark);
  padding: 14px 32px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 48px;
  box-shadow: 0 6px 20px rgba(147, 213, 184, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(147, 213, 184, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 14px 32px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 48px;
  font-weight: 600;
}

.btn-secondary:hover {
  border-color: var(--accent-green);
  color: var(--accent-green);
  background: rgba(147, 213, 184, 0.05);
  transform: translateY(-1px);
}

/* Progress Indicator */
.progress-indicator {
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(147, 213, 184, 0.08), rgba(147, 213, 184, 0.03));
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-title {
  color: var(--accent-green);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-percentage {
  color: var(--accent-green);
  font-weight: 700;
  font-size: 1.1rem;
}

.progress-bar {
  height: 10px;
  background: rgba(147, 213, 184, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-green-dark));
  border-radius: 10px;
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Auto-save Indicator */
.auto-save-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  justify-content: center;
  padding: 0 40px;
}

.auto-save-indicator i {
  font-size: 0.75rem;
}

.auto-save-indicator.saving {
  color: var(--warning);
}

.auto-save-indicator.saving i {
  animation: pulse 1s infinite;
}

.auto-save-indicator.saved {
  color: var(--success);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Error States */
.field-error {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 4px;
  display: block;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--error);
  background: rgba(249, 112, 102, 0.05);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(20, 35, 32, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
  backdrop-filter: blur(10px);
}

.loading-overlay.show {
  display: flex;
}

.loading-content {
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(147, 213, 184, 0.2);
  border-top-color: var(--accent-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.loading-content p {
  color: var(--accent-green);
  font-size: 1.1rem;
  font-weight: 600;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: -100px;
  right: 30px;
  padding: 16px 24px;
  background: var(--primary-dark);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.95rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: bottom 0.3s ease;
  z-index: 10000;
  max-width: 400px;
}

.toast.show {
  bottom: 30px;
}

.toast.success {
  border-color: var(--success);
  background: linear-gradient(135deg, rgba(123, 196, 163, 0.1), rgba(20, 35, 32, 0.9));
}

.toast.success::before {
  content: '✔ ';
  color: var(--success);
  font-weight: bold;
}

.toast.error {
  border-color: var(--error);
  background: linear-gradient(135deg, rgba(249, 112, 102, 0.1), rgba(20, 35, 32, 0.9));
}

.toast.error::before {
  content: '✕ ';
  color: var(--error);
  font-weight: bold;
}

.toast.warning {
  border-color: var(--warning);
  background: linear-gradient(135deg, rgba(253, 176, 34, 0.1), rgba(20, 35, 32, 0.9));
}

.toast.warning::before {
  content: '⚠ ';
  color: var(--warning);
  font-weight: bold;
}

/* Uploadcare Override */
.uploadcare--widget__button {
  display: none !important;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .profile-form-wrapper {
    border-radius: 12px;
  }

  .avatar-container {
    flex-direction: column;
    text-align: center;
  }

  .form-fields-container {
    padding: 20px;
  }

  .form-grid.two-col {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
    padding: 20px;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  .nav-menu {
    display: none;
  }

  .nav-container {
    padding: 10px 16px;
  }

  .page-header {
    padding: 80px 1rem 1.5rem;
  }

  .toast {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}

/* Focus Indicators for Accessibility */
*:focus {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --border-color: rgba(147, 213, 184, 0.4);
    --text-secondary: rgba(232, 241, 239, 0.9);
  }
  
  .form-input,
  .form-select,
  .form-textarea {
    border-width: 2px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles */
@media print {
  .navbar,
  .btn-primary,
  .btn-secondary,
  .btn-upload,
  .upload-hint,
  .auto-save-indicator,
  .progress-indicator {
    display: none !important;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .profile-form-wrapper {
    box-shadow: none;
    border: 1px solid #ccc;
    background: white;
  }
  
  .form-label {
    color: black;
  }
  
  .form-input,
  .form-textarea,
  .form-select {
    border: 1px solid #999;
    background: white;
    color: black;
  }
}