@import url('../../../assets/css/variables.css');

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

/* ==================== Header ==================== */
.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 15px 0;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo img {
  width: 36px;
  height: 36px;
}

.nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  color: #555;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

.nav-link.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  -webkit-text-fill-color: white;
}

/* ==================== Container ==================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

/* ==================== Card ==================== */
.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  padding: 25px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

/* ==================== Buttons ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

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

.btn:active {
  transform: translateY(0);
}

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

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background: #f0f0f0;
  color: #555;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-danger {
  background: #f44336;
  color: white;
}

.btn-danger:hover {
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #999;
  font-size: 16px;
  transition: color 0.2s;
}

.btn-icon:hover {
  color: #667eea;
}

.btn-icon.liked {
  color: #e91e63;
}

/* ==================== Forms ==================== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease;
  background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #667eea;
}

.form-textarea {
  resize: vertical;
  min-height: 200px;
  line-height: 1.6;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-hint {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.char-counter {
  text-align: right;
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.char-counter.warning {
  color: #f57c00;
}

.char-counter.danger {
  color: #f44336;
}

/* ==================== Category Badges ==================== */
.category-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.category-question { background: #e3f2fd; color: #1976d2; }
.category-experience { background: #e8f5e8; color: #388e3c; }
.category-job { background: #fff3e0; color: #f57c00; }
.category-general { background: #f3e5f5; color: #7b1fa2; }

/* ==================== Toast Notification ==================== */
.toast-notification {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 14px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: #4caf50;
  color: white;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.toast-error {
  background: #f44336;
  color: white;
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.toast-warning {
  background: #ff9800;
  color: white;
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

/* ==================== Password Prompt Modal ==================== */
.password-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.password-overlay.show {
  opacity: 1;
}

.password-modal {
  background: white;
  border-radius: 15px;
  padding: 30px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.password-modal h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: #333;
}

.password-modal-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 16px;
  transition: border-color 0.2s;
}

.password-modal-input:focus {
  outline: none;
  border-color: #667eea;
}

.password-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ==================== Loading ==================== */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e0e0e0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==================== Empty State ==================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 16px;
  margin-bottom: 8px;
}

.empty-state-sub {
  font-size: 14px;
  color: #bbb;
}

/* ==================== Breadcrumb ==================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: white;
}

.breadcrumb-sep {
  color: rgba(255, 255, 255, 0.4);
}

.breadcrumb-current {
  color: white;
  font-weight: 500;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
  .header-content {
    padding: 0 15px;
  }

  .logo {
    font-size: 18px;
  }

  .logo img {
    width: 28px;
    height: 28px;
  }

  .nav-links {
    gap: 4px;
  }

  .nav-link {
    padding: 6px 10px;
    font-size: 12px;
  }

  .container {
    padding: 20px 15px;
  }

  .card {
    padding: 20px 16px;
    border-radius: 12px;
  }

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

  .password-modal {
    width: 95%;
    padding: 24px;
  }

  /* iOS Safari auto-zoom prevention: any input/textarea/select used in
     community forms must be ≥16px on mobile to avoid the focus zoom */
  .form-input,
  .form-textarea,
  .form-select,
  .password-modal-input,
  .comment-form-input,
  .comment-form-textarea {
    font-size: 16px;
  }

  /* Body min-height: dvh fallback for iOS Safari address bar */
  body {
    min-height: 100vh;
    min-height: 100dvh;
  }
}
