:root {
  --primary: #6366f1;
  --primary-dark: #4338ca;
  --primary-light: #818cf8;
  --secondary: #4f46e5;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --text-light: #6b7280;
  --border-light: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; }

body { 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif; 
  background: var(--gray-50); 
  margin: 0; 
  padding: 0; 
  color: var(--gray-900);
  line-height: 1.6;
}

.hidden { display: none !important; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header - index.html과 동일 */
.header { 
  background: white;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding: 1rem 0;
}

.logo { 
  font-size: 1.75rem; 
  font-weight: 800; 
  background: linear-gradient(135deg, var(--primary), var(--secondary)); 
  -webkit-background-clip: text; 
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo a {
  text-decoration: none;
  color: inherit;
}

.breadcrumb {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 0.5rem;
  align-items: center;
}

.breadcrumb li {
  color: var(--text-light);
  font-size: 0.9rem;
}

.breadcrumb li:not(:last-child)::after {
  content: '>';
  margin-left: 0.5rem;
  color: var(--gray-300);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb a:hover {
  color: var(--primary-dark);
}

/* Navigation Actions */
.nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.guest-buttons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* 로그인된 사용자 정보 표시 - index.html과 동일 */
.user-info {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: background 0.2s ease;
}

/* 알림 벨 스타일 - index.html과 동일 */
.notification-bell {
  position: relative;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
}

.notification-bell:hover {
  transform: scale(1.1);
}

.notification-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
  display: none;
}

.notification-dot.active {
  display: block;
}

/* user-info-inner 컨테이너 - index.html과 동일 */
.user-info-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.5rem;
  transition: background 0.2s ease;
}

.user-info-inner:hover {
  background: var(--gray-50);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
}

.user-name {
  color: var(--gray-700);
  font-weight: 500;
  font-size: 14px;
}

.dropdown-icon {
  color: var(--gray-600);
  font-size: 12px;
  transition: transform 0.3s ease;
}

.user-info.active .dropdown-icon {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu {
  list-style: none;
  padding: 0.25rem 0;
  margin: 0;
}

.dropdown-menu li a,
.dropdown-menu li button {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: left;
  color: var(--gray-700);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 14px;
}

.dropdown-menu li a:hover,
.dropdown-menu li button:hover {
  background: var(--gray-50);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0.25rem 0;
}

.logout {
  color: var(--danger);
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  display: inline-block;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--gray-600);
  color: white;
}

.btn-secondary:hover {
  background: var(--gray-700);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Page Header */
.page-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.page-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.page-header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Main Content */
.main {
  padding: 3rem 0;
}

.content-wrapper {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.filter-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.filter-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.filter-group {
  margin-bottom: 1rem;
}

.filter-label {
  display: block;
  font-size: 0.9rem;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.filter-select {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.filter-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.filter-checkbox input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filter-checkbox label {
  font-size: 0.875rem;
  color: var(--gray-700);
  cursor: pointer;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Results Area */
.results-area {
  min-height: 400px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.results-count {
  font-size: 1.1rem;
  color: var(--gray-700);
}

.results-count strong {
  color: var(--primary);
}

.sort-select {
  padding: 0.625rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

.sales-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.sales-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: all 0.3s ease;
  cursor: pointer;
}

.sales-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.card-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.5rem;
}

.favorite-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.favorite-btn:hover {
  transform: scale(1.2);
}

.card-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0.5rem 0;
}

.card-mbti {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.card-info {
  color: var(--text-light);
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tag {
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 0.375rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.loading,
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}

/* Modal Styles */
.modal {
  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: 2000;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gray-200);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.modal-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  margin: 0.5rem 0 0 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--gray-400);
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.detail-section {
  margin: 2rem 0;
}

.detail-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.detail-item {
  padding: 1rem;
  background: var(--gray-50);
  border-radius: 0.5rem;
}

.detail-label {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.detail-value {
  font-size: 1rem;
  color: var(--gray-900);
  font-weight: 500;
}

.private-info {
  color: var(--text-light);
  font-style: italic;
}

.connection-alert {
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid #10b981;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.login-prompt {
  background: rgba(99, 102, 241, 0.1);
  border: 2px solid var(--primary);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1.5rem 0;
  text-align: center;
}

.matching-score-section {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(79, 70, 229, 0.05));
  border-radius: 1rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.score-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
}

.score-circle {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.score-details {
  display: grid;
  gap: 0.75rem;
}

.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  margin: 0 1rem;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.matching-reasons {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
}

.matching-reasons li {
  padding: 0.5rem 0;
  color: var(--gray-700);
  font-size: 0.875rem;
  display: flex;
  align-items: start;
}

.matching-reasons li span {
  margin-right: 0.5rem;
}

.connection-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.option-card {
  padding: 1.5rem;
  border: 2px solid var(--gray-200);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  background: white;
}

.option-card:hover {
  border-color: var(--primary);
  background: var(--gray-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.option-card.premium {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(79, 70, 229, 0.05));
  border-color: var(--primary);
}

.option-card .icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.option-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0.5rem 0;
}

.option-card p {
  font-size: 0.875rem;
  color: var(--text-light);
  margin: 0;
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--gray-100);
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-700);
}

.trust-badge.verified {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

/* Proposal Modal */
.proposal-modal .modal-section {
  margin-bottom: 1.5rem;
}

.proposal-modal .modal-section h4 {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  color: var(--gray-900);
}

.proposal-modal .checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.proposal-modal .checkbox-item {
  display: flex;
  align-items: start;
  gap: 0.5rem;
}

.proposal-modal .checkbox-item input[type="checkbox"] {
  margin-top: 0.25rem;
}

.proposal-modal .checkbox-item label {
  font-size: 0.875rem;
  color: var(--gray-700);
  cursor: pointer;
}

.proposal-modal .template-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.proposal-modal .template-option {
  padding: 1rem;
  border: 2px solid var(--gray-200);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.proposal-modal .template-option:hover {
  border-color: var(--primary);
  background: var(--gray-50);
}

.proposal-modal .template-option.selected {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.proposal-modal .template-option input[type="radio"] {
  display: none;
}

.proposal-modal .template-option strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--gray-900);
  font-size: 0.9rem;
}

.proposal-modal .template-option small {
  color: var(--text-light);
  font-size: 0.75rem;
}

.proposal-modal .ai-suggestion {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
  border: 1px solid var(--primary-light);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-top: 1rem;
}

.proposal-modal .ai-suggestion-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.proposal-modal .ai-suggestion-header strong {
  color: var(--primary);
  font-size: 0.9rem;
}

.proposal-modal .ai-suggestion p {
  font-size: 0.85rem;
  color: var(--gray-700);
  line-height: 1.5;
  margin: 0;
}

.proposal-modal .info-box {
  background: var(--gray-50);
  border-left: 3px solid var(--info);
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.proposal-modal .info-box strong {
  color: var(--info);
  display: block;
  margin-bottom: 0.5rem;
}

.proposal-modal .info-box ul {
  margin: 0.5rem 0 0 1.5rem;
  padding: 0;
}

.proposal-modal .info-box li {
  margin: 0.25rem 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  color: var(--gray-700);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-label.required::after {
  content: " *";
  color: var(--danger);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 2px solid var(--gray-200);
  border-radius: 0.5rem;
  font-size: 0.95rem;
  transition: all 0.2s;
  background: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 1024px) {
  .content-wrapper {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: static;
  }
  
  .sales-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
  
  .connection-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
  
  .nav {
    flex-direction: column;
    gap: 1rem;
  }
  
  .user-name {
    display: none;
  }
  
  .sales-grid {
    grid-template-columns: 1fr;
  }
  
  .results-header {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .proposal-modal .template-selector {
    grid-template-columns: 1fr;
  }
}