/* CSS reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; line-height: 1.5; color: #222; background: #f8f8f8; }
.section { width: 100%; }
.container { max-width: 1500px; width: 100%; margin: 0 auto; padding: 0 20px; }
.error { color: #F00; font-weight: bold; font-size: 18px; padding-bottom: 20px; }

/* Headers */
.header { background: #fff; border-bottom: 1px solid #ddd; padding: 16px 0; }
.header .container { display: flex; align-items: flex-end; justify-content: space-between; min-height: 70px; }
.logo-space { width: 329px; height: 100px; display: flex; align-items: center; justify-content: center; }
.header-btn { width: 100px; padding: 8px 0; background: #fff; border: 1.5px solid #4a6fa5; border-radius: 4px; color: #4a6fa5; font-size: 14px; cursor: pointer; text-decoration: none; text-align: center; display: inline-block; }
.header-btn:hover { background: #00D4FF; }
.header-buttons { display: flex; gap: 12px; }

/* Header search bar */
.search-bar { background: #b0b0b0; padding: 10px 0; border-top: 1px solid #999; }
.search-bar .container { display: flex; align-items: center; justify-content: center; gap: 12px; }
.search-bar label { font-weight: 700; font-size: 15px; white-space: nowrap; }
.search-bar input[type="text"] { width: 260px; padding: 6px 10px; border: 1px solid #666; border-radius: 3px; font-size: 14px; }
.search-bar .update-btn { padding: 6px 14px; background: #e8e8e8; border: 1px solid #888; border-radius: 4px; font-size: 14px; cursor: pointer; }
.search-bar .update-btn:hover { background: #00D4FF; }

/* Header Compressed */
.site-header { position: fixed; top: 0; left: 0; width: 100%; height: 70px; background: #fff; border-bottom: 1px solid #ddd; z-index: 150; }
.header-container { max-width: 1500px; width: 100%; height: 100%; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; }
.site-header .logo-space { width: 140px; height: 40px; display: flex; align-items: center; justify-content: center; }
.site-header .header-buttons { margin-left: auto; display: flex; gap: 10px; }
.site-header .header-btn { padding: 6px 0; width: 100px; background: #fff; border: 1.5px solid #4a6fa5; border-radius: 4px; color: #4a6fa5; font-size: 13px; text-decoration: none; text-align: center; display: inline-block; }
.site-header .header-btn:hover { background: #00D4FF; }

/* Home page specific */
.main { padding: 25px 0 0; }
.hero { display: flex; gap: 24px; margin-bottom: 25px; min-height: 260px; background-image: url(../images/hero.jpg); background-repeat: no-repeat; background-position: left center; background-size: cover; }
.hero-image { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 400px; }
.hero-right { flex: 1; display: flex; flex-direction: column; padding: 24px; position: relative; }
.hard-sell-box { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; margin-bottom: 16px; font-size: 20px; color: #ccc; }
.hard-sell-box h2 { font-size: 24px; margin-bottom: 16px; }
.hero-right i, .hard-sell-box i, .sell-box i { color: #4a6fa5; text-transform: lowercase; }

.cta { display: inline-block; padding: 8px 18px; background: #fff; border: 1px solid #4a6fa5; border-radius: 6px; font-size: 16px; text-decoration: none; font-weight: bold; color: #4a6fa5; align-self: flex-end; }
.cta:hover { background: #00D4FF; }

.sell-row { display: flex; gap: 24px; margin-bottom: 25px; }
.sell-box { background: #fff; min-height: 220px; display: flex; flex-direction: column; padding: 24px; }
.sell-text { flex: 2; justify-content: space-between; min-height: 300px; }
.sell-image { flex: 1; align-items: center; justify-content: center; color: #666; font-size: 18px; min-height: 300px; }
.sell-text p { flex: 1; display: flex; align-items: center; justify-content: center; color: #555; font-size: 18px; }
.sell-image1 { background-image: url(../images/intuitive.jpg); background-repeat: no-repeat; background-position: left center; background-size: cover; }
.sell-image2 { background-image: url(../images/realtime.jpg); background-repeat: no-repeat; background-position: left center; background-size: cover; }

/* Search page specific */
.search-section { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 520px; margin: 0 auto; }
.search-section h1 { font-size: 24px; font-weight: 600; margin-bottom: 28px; color: #222; }
.search-section input[type="text"] { width: 100%; max-width: 360px; padding: 10px 14px; border: 1.5px solid #4a6fa5; border-radius: 4px; font-size: 15px; margin-bottom: 22px; outline: none; }
.search-section input[type="text"]:focus { border-color: #3a5a8a; box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.15); }
.search-section input[type="password"] { width: 100%; max-width: 360px; padding: 10px 14px; border: 1.5px solid #4a6fa5; border-radius: 4px; font-size: 15px; margin-bottom: 22px; outline: none; }
.search-section input[type="password"]:focus { border-color: #3a5a8a; box-shadow: 0 0 0 2px rgba(74, 111, 165, 0.15); }
.search-buttons-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.search-btn { padding: 8px 16px; background: #fff; border: 1.5px solid #4a6fa5; border-radius: 6px; color: #4a6fa5; font-size: 14px; cursor: pointer; text-decoration: none; }
.search-btn:hover { background: #00D4FF; }
.wildcard-btn { margin-top: 4px; padding: 8px 50px; }

/* Results page specific */
.results-section { max-width: 1200px; width: 100%; margin: 0 auto; }
.results-section h1 { font-size: 22px; font-weight: 600; margin-bottom: 28px; color: #222; }
.result-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid #e0e0e0; }
.result-row:last-child { border-bottom: none; }
.result-text { flex: 1; font-size: 15px; color: #333; }
.result-actions { display: flex; gap: 10px; flex-shrink: 0; }
.result-btn { padding: 7px 16px; background: #fff; border: 1.5px solid #4a6fa5; border-radius: 6px; color: #4a6fa5; font-size: 13px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.result-btn:hover { background: #00D4FF; }

/* Info cards display */
.card-unit { position: relative; z-index: 10; }
.card { position: relative; width: 340px; background: #fff; border: 1.5px solid #4a6fa5; border-radius: 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); }
.card-header { background: #a8b8e0; padding: 12px 16px; border-radius: 8px 8px 0 0; font-weight: 700; position: relative; cursor: move; user-select: none; }
.type-icon { position: absolute; top: -18px; right: -10px; width: 70px; height: 70px; background: #a8b8e0; border: 2px solid #4a6fa5; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; text-align: center; line-height: 1.2; }
.card-company { background: #a8b8e0; border-color: #4a6fa5; }
.card-company-border { background: #a8b8e0; border-color: #4a6fa5; }
.card-person { background: #d0f0d0; border-color: #5a9e5a; }
.card-person-border { border-color: #5a9e5a; }
.card-address { background: #f0d0d0; border-color: #9e5a5a; }
.card-address-border { border-color: #9e5a5a; }
.card-body { padding: 18px 16px; }
.company-name { font-size: 14px; margin-bottom: 12px; }
.section-title { font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13px; }
.btn { padding: 4px 12px; border: 1.5px solid #4a6fa5; border-radius: 6px; background: #fff; font-size: 12px; cursor: pointer; }
.btn:hover { background: #00D4FF; }
.btn-primary { background: #00D4FF; color: #fff; }
.btn-primary:hover { background: #4a6fa5; }
/* Panels – high local z-index so they sit above the card face */
.panel { display: none; position: absolute; background: #fff; border: 1.5px solid #4a6fa5; border-radius: 8px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12); padding: 12px; z-index: 30; }
.panel.visible { display: block; }
.list-panel { width: 275px; }
.details-panel { width: 280px; padding: 16px; }
.details-body { font-size: 14px; }
.person-item { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #eee; font-size: 13px; }
.person-item:last-child { border-bottom: none; }
.details-actions, .panel-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.hidden { display: none; }
.detail-list { overflow: hidden; max-width: 160px; height: 23px; word-wrap: break-word; white-space: pre-wrap; word-break: break-word; }
.list-panel-scroll {max-height: 250px; overflow: hidden; overflow-x: hidden; overflow-y: scroll;}
/* Speech-bubble tail */
.panel::before, .panel::after { content: ''; position: absolute; left: -10px; top: 52px; width: 0; height: 0; }
.panel::before { border-top: 9px solid transparent; border-bottom: 9px solid transparent; border-right: 10px solid #4a6fa5; }
.panel::after { left: -8px; top: 54px; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-right: 8px solid #fff; }

/* Connector layer */
#connectors { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
#connectors path { fill: none; stroke: #4a6fa5; stroke-width: 2; stroke-linecap: round; }

/* Footer specific */
.footer { background: #2c3e50; color: #eee; padding: 40px 0 20px; }
.footer-cols { display: flex; gap: 30px; margin-bottom: 30px; }
.footer-col { flex: 1; }
.footer-col h3 { font-size: 16px; margin-bottom: 14px; color: #fff; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col a { color: #bbb; text-decoration: none; font-size: 14px; }
.footer-col a:hover { color: #fff; }
.footer-logo { height: 200px; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.social-links { display: flex; gap: 12px; margin-top: 12px; justify-content: flex-end; }
.social-links a { display: inline-block; width: 32px; height: 32px; border: 1px solid #7a8a9a; border-radius: 50%; text-align: center; line-height: 30px; font-size: 12px; }
.copyright { border-top: 1px solid #445566; padding-top: 18px; text-align: center; font-size: 13px; color: #99a; }

/* Responsive extras */
@media (max-width: 768px) {
  .hero, .sell-row, .footer-cols { flex-direction: column; }
  .hero-image { min-height: 180px; }
  .header .container { align-items: center; flex-wrap: wrap; gap: 12px; }
  .header-buttons { flex-wrap: wrap; }
  .search-bar .container { flex-wrap: wrap; }
  .search-bar input[type="text"] { width: 100%; max-width: 260px; }
  .search-btn { width: 200px; }
  .result-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .result-actions { width: 100%; }
  .result-btn { flex: 1; text-align: center; }
}