/* =============================================
   VARAVARASTO PUBLIC WEBSITE – STYLES
   ============================================= */

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #0c4a6e;
  --primary-light: #0e7490;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --green: #059669;
  --green-light: #d1fae5;
  --yellow: #d97706;
  --yellow-light: #fef3c7;
  --red: #dc2626;
  --bg: #f0f4f8;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }

.shell { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.skip-link {
  position: absolute; left: -999px; top: auto;
  background: var(--accent); color: #fff; padding: 8px 16px; z-index: 999;
}
.skip-link:focus { left: 8px; top: 8px; }

main {
  min-height: calc(100vh - 200px); /* Push footer down */
  padding-top: 72px; /* Offset for fixed header */
}

/* === HEADER === */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s;
}
.site-header.scrolled { box-shadow: var(--shadow-md); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
}
.brand img { height: 36px; width: auto; }

.main-nav { display: flex; gap: 8px; }
.nav-link {
  padding: 8px 18px; border-radius: 8px; font-weight: 500; font-size: 15px;
  color: var(--text-secondary); transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary); background: rgba(12,74,110,0.06);
}
.nav-link.active { font-weight: 600; }

.cta-phone {
  display: flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff;
  padding: 10px 20px; border-radius: 50px;
  font-weight: 600; font-size: 14px;
  transition: background 0.2s;
}
.cta-phone:hover { background: var(--primary-light); }

.nav-toggle { display: none; width: 32px; height: 24px; position: relative; }
.nav-toggle span {
  display: block; width: 100%; height: 2px; background: var(--text);
  position: absolute; left: 0; transition: all 0.3s;
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-toggle span:nth-child(3) { bottom: 0; }
.nav-toggle.open span:nth-child(1) { top: 50%; transform: translateY(-50%) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

/* === HERO === */
.hero {
  padding: 68px 0 80px;
  background: linear-gradient(135deg, #0c4a6e 0%, #164e63 40%, #155e75 100%);
  color: #fff;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(37,99,235,0.15) 0%, transparent 60%);
}
.hero::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 60px;
  background: linear-gradient(transparent, var(--bg));
}
.hero-inner { position: relative; z-index: 1; display: flex; gap: 60px; align-items: center; }
.hero-text { flex: 1; }
.hero-text h1 {
  font-family: var(--font-display); font-size: 44px; font-weight: 800;
  line-height: 1.15; margin-bottom: 20px;
}
.hero-text h1 span { color: #67e8f9; }
.hero-text p {
  font-size: 18px; color: rgba(255,255,255,0.8); max-width: 520px;
  margin-bottom: 32px; line-height: 1.7;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 28px; border-radius: 50px; font-weight: 600; font-size: 15px;
  transition: all 0.2s; cursor: pointer; border: 2px solid transparent;
}
.btn-primary { background: #fff; color: var(--primary); }
.btn-primary:hover { background: #f0f4f8; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-secondary:hover { border-color: #fff; background: rgba(255,255,255,0.1); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #047857; }
.btn-sm { padding: 10px 20px; font-size: 14px; }

.hero-visual { flex: 0 0 400px; }

/* === FEATURES STRIP === */
.features-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  margin-top: -40px; position: relative; z-index: 2;
}
.feature-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 28px 24px;
  box-shadow: var(--shadow-md); text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 24px;
}
.feature-icon.blue { background: rgba(37,99,235,0.1); color: var(--accent); }
.feature-icon.green { background: rgba(5,150,105,0.1); color: var(--green); }
.feature-icon.orange { background: rgba(217,119,6,0.1); color: var(--yellow); }
.feature-icon.primary { background: rgba(12,74,110,0.1); color: var(--primary); }
.feature-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.feature-card p { font-size: 13px; color: var(--text-secondary); }

/* === LOCATIONS SECTION === */
.section { padding: 80px 0; }
.section-title {
  font-family: var(--font-display); font-size: 32px; font-weight: 700;
  text-align: center; margin-bottom: 12px; color: var(--primary);
}
.section-subtitle {
  text-align: center; color: var(--text-secondary); font-size: 16px;
  margin-bottom: 48px; max-width: 600px; margin-left: auto; margin-right: auto;
}

.locations-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.location-card {
  background: var(--bg-card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid var(--border);
}
.location-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.location-card-img {
  height: 200px; background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.15); font-size: 80px; font-weight: 800;
  font-family: var(--font-display);
}
.location-card-body { padding: 28px; }
.location-card-body h3 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.location-card-body .address { color: var(--text-secondary); font-size: 14px; margin-bottom: 16px; }
.location-card-body .meta {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.meta-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-secondary);
}
.meta-item .dot { width: 8px; height: 8px; border-radius: 50%; }
.meta-item .dot.green { background: var(--green); }

/* === VARASTOT PAGE === */
.varastot-header { padding: 120px 0 40px; background: var(--primary); color: #fff; }
.varastot-header h1 {
  font-family: var(--font-display); font-size: 36px; font-weight: 800;
  margin-bottom: 8px;
}
.varastot-header p { color: rgba(255,255,255,0.7); font-size: 16px; }

.location-tabs {
  display: flex; gap: 8px; margin-bottom: 32px; padding-top: 32px;
}
.location-tab {
  padding: 12px 28px; border-radius: 50px; font-weight: 600; font-size: 15px;
  background: var(--bg-card); color: var(--text-secondary);
  border: 2px solid var(--border); cursor: pointer; transition: all 0.2s;
}
.location-tab:hover { border-color: var(--accent); color: var(--accent); }
.location-tab.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

.map-section {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 40px;
}
.map-container {
  height: 320px; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
}
.map-info {
  background: var(--bg-card); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: center;
}
.map-info h3 { font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.map-info-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.map-info-item:last-child { border-bottom: none; }
.map-info-item .icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.directions-btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 16px;
  background: var(--accent); color: #fff; padding: 12px 24px;
  border-radius: 50px; font-weight: 600; font-size: 14px;
  transition: background 0.2s; border: none; cursor: pointer;
}
.directions-btn:hover { background: var(--accent-hover); }

.units-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.unit-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.unit-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.unit-badge {
  display: inline-block; padding: 4px 12px; border-radius: 50px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
  margin-bottom: 12px;
}
.unit-badge.available { background: var(--green-light); color: var(--green); }
.unit-badge.reserved { background: var(--yellow-light); color: var(--yellow); }
.unit-size { font-size: 24px; font-weight: 800; font-family: var(--font-display); margin-bottom: 4px; }
.unit-volume { font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; }
.unit-price {
  font-size: 28px; font-weight: 800; color: var(--primary);
  font-family: var(--font-display); margin-bottom: 4px;
}
.unit-price-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 16px; }
.unit-features { list-style: none; margin-bottom: 20px; }
.unit-features li {
  padding: 6px 0; font-size: 13px; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
}
.unit-features li::before { content: '✓'; color: var(--green); font-weight: 700; }
.unit-actions { display: flex; gap: 8px; }
.unit-actions .btn { flex: 1; justify-content: center; }

.no-units {
  text-align: center; padding: 60px 20px; color: var(--text-secondary);
  font-size: 16px;
}

/* === TIETOA PAGE === */
.tietoa-header { padding: 120px 0 40px; background: var(--primary); color: #fff; }
.tietoa-header h1 {
  font-family: var(--font-display); font-size: 36px; font-weight: 800;
  margin-bottom: 8px;
}
.tietoa-content { padding: 48px 0; }
.tietoa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.tietoa-text {
  background: var(--bg-card); border-radius: var(--radius); padding: 40px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.tietoa-text h2 {
  font-family: var(--font-display); font-size: 24px; font-weight: 700;
  color: var(--primary); margin-bottom: 16px;
}
.tietoa-text p { color: var(--text-secondary); margin-bottom: 16px; line-height: 1.8; }
.tietoa-text ul { list-style: none; margin-bottom: 16px; }
.tietoa-text ul li {
  padding: 8px 0; font-size: 15px; display: flex; align-items: center; gap: 10px;
}
.tietoa-text ul li::before { content: '✓'; color: var(--green); font-weight: 700; font-size: 18px; }

.contact-form {
  background: var(--bg-card); border-radius: var(--radius); padding: 40px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--border);
}
.contact-form h2 {
  font-family: var(--font-display); font-size: 24px; font-weight: 700;
  color: var(--primary); margin-bottom: 24px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 16px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font);
  transition: border-color 0.2s; background: var(--bg);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-group textarea { min-height: 120px; resize: vertical; }

/* === SVG FLOOR PLAN === */
.floor-plan-section {
  margin-bottom: 40px;
}
.floor-plan-wrapper {
  background: var(--bg-card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
  overflow: hidden; position: relative;
}
.floor-plan-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 16px; flex-wrap: wrap; gap: 12px;
}
.floor-plan-toolbar h3 {
  font-family: var(--font-display); font-size: 20px; font-weight: 700; margin: 0;
}
.floor-plan-legend {
  display: flex; gap: 16px; align-items: center; font-size: 13px;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot {
  width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.1);
}
.legend-dot.available { background: rgba(5, 150, 105, 0.45); }
.legend-dot.rented { background: rgba(239, 68, 68, 0.35); }
.legend-dot.reserved { background: rgba(217, 119, 6, 0.45); }

.floor-plan-svg-container {
  width: 100%; overflow-x: auto; overflow-y: hidden;
  cursor: grab; position: relative;
}
.floor-plan-svg-container:active { cursor: grabbing; }
.floor-plan-svg-container svg {
  max-width: 100%; height: auto; display: block;
}

.floor-plan-svg-container svg rect[data-unit-id] {
  cursor: pointer;
  transition: all 0.2s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.floor-plan-svg-container svg rect[data-unit-id] + g {
  transition: all 0.2s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.floor-plan-svg-container svg rect[data-unit-id]:hover {
  stroke-width: 3 !important;
  filter: brightness(1.2) drop-shadow(0px 4px 8px rgba(0,0,0,0.3));
  transform: scale(1.05);
}
.floor-plan-svg-container svg rect[data-unit-id]:hover + g {
  transform: scale(1.05);
}
.floor-plan-svg-container svg rect[data-unit-id].unit-available {
  fill: rgba(5, 150, 105, 0.45) !important;
  stroke: #059669 !important;
}
.floor-plan-svg-container svg rect[data-unit-id].unit-rented {
  fill: rgba(239, 68, 68, 0.25) !important;
  stroke: #ef4444 !important;
  cursor: default;
}
.floor-plan-svg-container svg rect[data-unit-id].unit-reserved {
  fill: rgba(217, 119, 6, 0.35) !important;
  stroke: #d97706 !important;
}
.floor-plan-svg-container svg rect[data-unit-id].unit-selected {
  fill: rgba(37, 99, 235, 0.5) !important;
  stroke: #2563eb !important;
  stroke-width: 3 !important;
}

/* Tooltip */
.svg-tooltip {
  position: fixed; z-index: 200;
  background: #1e293b; color: #fff;
  padding: 12px 16px; border-radius: 10px;
  font-size: 13px; pointer-events: none;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  max-width: 240px; line-height: 1.5;
  opacity: 0; transition: opacity 0.15s;
}
.svg-tooltip.visible { opacity: 1; }
.svg-tooltip .tt-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.svg-tooltip .tt-price { font-weight: 700; color: #67e8f9; font-size: 16px; }
.svg-tooltip .tt-badge {
  display: inline-block; padding: 2px 8px; border-radius: 50px;
  font-size: 11px; font-weight: 600; margin-top: 4px;
}
.svg-tooltip .tt-badge.available { background: rgba(5,150,105,0.3); color: #6ee7b7; }
.svg-tooltip .tt-badge.rented { background: rgba(239,68,68,0.3); color: #fca5a5; }
.svg-tooltip .tt-badge.reserved { background: rgba(217,119,6,0.3); color: #fcd34d; }

/* Selected unit detail card */
.selected-unit-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-md); border: 2px solid var(--accent);
  margin-top: 20px; display: flex; align-items: center; gap: 24px;
  animation: fadeInUp 0.3s ease;
}
.selected-unit-card .suc-info { flex: 1; }
.selected-unit-card .suc-info h3 {
  font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 8px;
}
.selected-unit-card .suc-details {
  display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 12px;
  font-size: 14px; color: var(--text-secondary);
}
.selected-unit-card .suc-price {
  font-size: 28px; font-weight: 800; color: var(--primary);
  font-family: var(--font-display);
}
.selected-unit-card .suc-price small { font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.selected-unit-card .suc-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* === FOOTER === */
.site-footer {
  background: #0f172a; color: rgba(255,255,255,0.7); padding: 60px 0 0;
}
.footer-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 40px;
}
.footer-col h4 {
  color: #fff; font-weight: 600; font-size: 15px; margin-bottom: 16px;
}
.footer-col p { font-size: 14px; margin-bottom: 12px; line-height: 1.6; }
.footer-col a { color: rgba(255,255,255,0.7); transition: color 0.2s; }
.footer-col a:hover { color: #fff; }
.footer-desc { font-size: 14px; line-height: 1.7; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08); padding: 20px 0;
}
.footer-bottom p { font-size: 13px; text-align: center; }

/* === LOADING === */
.loading {
  display: flex; align-items: center; justify-content: center;
  padding: 60px; color: var(--text-secondary);
}
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin-right: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.5s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .hero-inner { flex-direction: column; text-align: center; }
  .hero-text h1 { font-size: 32px; }
  .hero-text p { margin: 0 auto 32px; }
  .hero-cta { justify-content: center; }
  .hero-visual { display: none; }
  .features-strip { grid-template-columns: repeat(2, 1fr); }
  .locations-grid { grid-template-columns: 1fr; }
  .map-section { grid-template-columns: 1fr; }
  .tietoa-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}

@media (max-width: 640px) {
  .main-nav { 
    display: none; position: fixed; top: 72px; left: 0; right: 0;
    background: #fff; padding: 20px; flex-direction: column;
    box-shadow: var(--shadow-lg); border-bottom: 1px solid var(--border);
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .cta-phone span { display: none; }
  .cta-phone { padding: 10px; border-radius: 50%; }
  .features-strip { grid-template-columns: 1fr; margin-top: -20px; }
  .hero { padding: 120px 0 60px; }
  .hero-text h1 { font-size: 28px; }
  .section-title { font-size: 26px; }
  .units-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .location-tabs { flex-wrap: wrap; }
}
