/* Security Atlas - Main Styles */
/* Enterprise Security Architecture Platform */

:root {
  /* Base Colors */
  --bg: #070d1a;
  --bg2: #0a1020;
  --bg-modal: rgba(7, 13, 26, 0.95);
  
  /* Industry-standard Color Palette */
  --blue: #0062fe;
  --blue2: #4589ff;
  --blue3: #78a9ff;
  --blue4: #a6c8ff;
  
  /* Accent Colors */
  --cyan: #0bc5e0;
  --teal: #009d9a;
  --green: #24a148;
  --purple: #7c3dd6;
  --red: #da1e28;
  --orange: #ff832b;
  --yellow: #f1c21b;
  
  /* Text Colors */
  --text: #c7d3e8;
  --muted: #697077;
  --dim: #a2a9b0;
  --white: #ffffff;
  
  /* Maturity Level Colors */
  --level-1: #da1e28; /* Red - Initial */
  --level-2: #ff832b; /* Orange - Developing */
  --level-3: #f1c21b; /* Yellow - Defined */
  --level-4: #0062fe; /* Blue - Managed */
  --level-5: #24a148; /* Green - Optimizing */
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  line-height: 1.6;
}

/* Header */
.hdr {
  position: sticky;
  top: 0;
  z-index: 200;
  background: linear-gradient(135deg, #001141 0%, #001d6c 60%, #0043ce 100%);
  border-bottom: 2px solid var(--blue);
  box-shadow: 0 2px 12px rgba(0, 98, 254, 0.3);
  padding: 18px 48px 0;
  will-change: transform;
  transform: translateZ(0);
}

.hdr-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 12px;
}

.hdr-left {
  flex: 1;
}

.hdr h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.5px;
  margin-bottom: 3px;
}

.hdr p {
  font-size: 12px;
  color: var(--blue4);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.hdr-right {
  text-align: right;
}

.hdr-right strong {
  display: block;
  font-size: 11px;
  color: var(--blue4);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.hdr-right span {
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
}

/* Tabs */
.tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tab-list {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  flex: 1;
}

.tab-btn {
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  background: transparent;
  color: rgba(166, 200, 255, 0.55);
  border: none;
  border-radius: 3px 3px 0 0;
  cursor: pointer;
  transition: all 0.2s;
  border-top: 2px solid transparent;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--blue4);
  background: rgba(0, 98, 254, 0.08);
}

.tab-btn.on {
  background: var(--bg);
  color: var(--white);
  border-top-color: var(--blue);
}

.hdr-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  padding-bottom: 4px;
}

.btn-y {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #000;
  text-decoration: none;
  padding: 7px 16px;
  background: var(--yellow);
  border-radius: 2px;
  white-space: nowrap;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-y:hover {
  background: #ffd666;
  transform: translateY(-1px);
}

.btn-o {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--yellow);
  text-decoration: none;
  padding: 7px 16px;
  border: 1px solid rgba(241, 194, 27, 0.4);
  border-radius: 2px;
  white-space: nowrap;
  font-weight: 600;
  background: rgba(241, 194, 27, 0.08);
  transition: all 0.2s;
}

.btn-o:hover {
  border-color: var(--yellow);
  background: rgba(241, 194, 27, 0.15);
}

/* Tab Panels */
.panel {
  display: none;
  background: var(--bg);
  contain: layout style;
}

.panel.on {
  display: block;
}

.scroll-x {
  overflow-x: auto;
  background: var(--bg);
}

.mw1200 {
  min-width: 1200px;
  background: var(--bg);
}

/* Intro Box */
.intro {
  background: rgba(255, 255, 255, 0.025);
  border-radius: 0 5px 5px 0;
  padding: 18px 24px;
  margin: 0 40px 4px;
  border-left: 3px solid var(--blue);
}

.intro-tag {
  font-size: 11.5px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: 7px;
  color: var(--blue3);
}

.intro h2 {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.intro p {
  font-size: 14px;
  color: var(--dim);
  line-height: 1.85;
  max-width: 1000px;
}

/* Canvas & Layers */
.canvas {
  padding: 28px 40px 48px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transform: translateZ(0);
}

.layer {
  display: grid;
  grid-template-columns: 140px 1fr;
  min-height: 100px;
  background: var(--bg);
}

.layer-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px 8px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  border-right: 2px solid rgba(255, 255, 255, 0.07);
  gap: 6px;
}

.layer-label .li {
  font-size: 18px;
  transform: rotate(180deg);
  writing-mode: horizontal-tb;
}

.layer-content {
  padding: 12px 18px;
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: var(--bg);
}

/* Zones */
.zone {
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 9px 12px;
  transition: all 0.2s;
  cursor: pointer;
  min-width: 180px;
}

.zone:hover {
  outline: 2px solid rgba(0, 98, 254, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 98, 254, 0.2);
}

.zone-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.zone-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.zone-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.item {
  font-size: 13px;
  color: #dde1e6;
  padding: 2px 7px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.035);
  border-left: 2px solid transparent;
  white-space: nowrap;
}

/* Layer-specific colors */
/* Layer 1: Identity & Access - Blue */
.layer-iam .layer-label {
  background: rgba(7, 0, 100, 0.35);
  color: var(--blue3);
}

.layer-iam .zone {
  background: rgba(0, 61, 154, 0.16);
  border-color: rgba(0, 98, 254, 0.22);
}

.layer-iam .zone-title {
  color: var(--blue2);
}

.layer-iam .zone-dot {
  background: var(--blue);
}

.layer-iam .item {
  border-left-color: var(--blue);
}

/* Layer 2: Application Security - Teal */
.layer-app .layer-label {
  background: rgba(0, 157, 154, 0.18);
  color: #5fd4d1;
}

.layer-app .zone {
  background: rgba(0, 157, 154, 0.09);
  border-color: rgba(0, 157, 154, 0.22);
}

.layer-app .zone-title {
  color: #5fd4d1;
}

.layer-app .zone-dot {
  background: var(--teal);
}

.layer-app .item {
  border-left-color: var(--teal);
}

/* Layer 3: Data Security - Cyan */
.layer-data .layer-label {
  background: rgba(11, 197, 224, 0.18);
  color: #82e9ff;
}

.layer-data .zone {
  background: rgba(11, 197, 224, 0.09);
  border-color: rgba(11, 197, 224, 0.22);
}

.layer-data .zone-title {
  color: #82e9ff;
}

.layer-data .zone-dot {
  background: var(--cyan);
}

.layer-data .item {
  border-left-color: var(--cyan);
}

/* Layer 4: Network Security - Purple */
.layer-network .layer-label {
  background: rgba(124, 61, 214, 0.18);
  color: #be95ff;
}

.layer-network .zone {
  background: rgba(124, 61, 214, 0.09);
  border-color: rgba(124, 61, 214, 0.22);
}

.layer-network .zone-title {
  color: #be95ff;
}

.layer-network .zone-dot {
  background: var(--purple);
}

.layer-network .item {
  border-left-color: var(--purple);
}

/* Layer 5: Infrastructure Security - Orange */
.layer-infra .layer-label {
  background: rgba(255, 131, 43, 0.18);
  color: #ffb784;
}

.layer-infra .zone {
  background: rgba(255, 131, 43, 0.09);
  border-color: rgba(255, 131, 43, 0.22);
}

.layer-infra .zone-title {
  color: #ffb784;
}

.layer-infra .zone-dot {
  background: var(--orange);
}

.layer-infra .item {
  border-left-color: var(--orange);
}

/* Layer 6: Endpoint Security - Green */
.layer-endpoint .layer-label {
  background: rgba(36, 161, 72, 0.18);
  color: #6fdc8c;
}

.layer-endpoint .zone {
  background: rgba(36, 161, 72, 0.09);
  border-color: rgba(36, 161, 72, 0.22);
}

.layer-endpoint .zone-title {
  color: #6fdc8c;
}

.layer-endpoint .zone-dot {
  background: var(--green);
}

.layer-endpoint .item {
  border-left-color: var(--green);
}

/* Layer 7: Security Operations - Blue (darker) */
.layer-secops .layer-label {
  background: rgba(0, 98, 254, 0.25);
  color: var(--blue3);
}

.layer-secops .zone {
  background: rgba(0, 98, 254, 0.12);
  border-color: rgba(0, 98, 254, 0.25);
}

.layer-secops .zone-title {
  color: var(--blue3);
}

.layer-secops .zone-dot {
  background: var(--blue2);
}

.layer-secops .item {
  border-left-color: var(--blue2);
}

/* Layer 8: GRC - Yellow */
.layer-grc .layer-label {
  background: rgba(241, 194, 27, 0.18);
  color: #fddc69;
}

.layer-grc .zone {
  background: rgba(241, 194, 27, 0.09);
  border-color: rgba(241, 194, 27, 0.22);
}

.layer-grc .zone-title {
  color: #fddc69;
}

.layer-grc .zone-dot {
  background: var(--yellow);
}

.layer-grc .item {
  border-left-color: var(--yellow);
}

/* Maturity Level Styling */
.zone[data-level="1"] {
  border-color: var(--level-1) !important;
  box-shadow: 0 0 0 1px var(--level-1) inset;
}

.zone[data-level="2"] {
  border-color: var(--level-2) !important;
  box-shadow: 0 0 0 1px var(--level-2) inset;
}

.zone[data-level="3"] {
  border-color: var(--level-3) !important;
  box-shadow: 0 0 0 1px var(--level-3) inset;
}

.zone[data-level="4"] {
  border-color: var(--level-4) !important;
  box-shadow: 0 0 0 1px var(--level-4) inset;
}

.zone[data-level="5"] {
  border-color: var(--level-5) !important;
  box-shadow: 0 0 0 1px var(--level-5) inset;
}

/* Legend */
.legend {
  margin: 0 40px 36px;
  padding: 15px 22px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: center;
}

.legend-title {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  margin-right: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.legend-color {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg2);
  border: 2px solid var(--blue);
  border-radius: 8px;
  padding: 32px;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 98, 254, 0.3);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 24px;
  font-size: 32px;
  font-weight: 300;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.modal-close:hover {
  color: var(--white);
}

/* Responsive */
@media (max-width: 1024px) {
  .hdr {
    padding: 16px 24px 0;
  }
  
  .intro {
    margin: 0 24px 4px;
  }
  
  .canvas {
    padding: 24px 24px 36px;
  }
  
  .legend {
    margin: 0 24px 24px;
  }
}

@media (max-width: 768px) {
  .hdr-top {
    flex-direction: column;
    gap: 12px;
  }
  
  .hdr-right {
    text-align: left;
  }
  
  .tabs {
    flex-direction: column;
    align-items: stretch;
  }
  
  .tab-list {
    overflow-x: auto;
  }
  
  .hdr-actions {
    width: 100%;
    justify-content: stretch;
  }
  
  .btn-y, .btn-o {
    flex: 1;
    text-align: center;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg2);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 98, 254, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 98, 254, 0.5);
}
