/* Base Styles */
:root {
  --neon-blue: #08f;
  --neon-purple: #a0f;
  --neon-pink: #f0f;
  --dark-bg: #0a0a12;
  --darker-bg: #050508;
  --glass-bg: rgba(15, 15, 25, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f0f0ff;
  --text-secondary: #b0b0d0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', sans-serif;
  background: var(--dark-bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(0, 136, 255, 0.1) 0%, transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(160, 0, 255, 0.1) 0%, transparent 30%);
  overflow-x: hidden;
}

/* Particles Background */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

/* Glass Morphism Container */
.glass-container {
  width: 95%;
  max-width: 1200px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(0, 136, 255, 0.1),
    0 0 20px rgba(160, 0, 255, 0.1) inset;
  padding: 2rem;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.glass-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 136, 255, 0.1) 0%, transparent 70%);
  animation: rotate 60s linear infinite;
  z-index: -1;
}

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Header Styles */
.app-header {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.app-header h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

.neon-text {
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 10px rgba(0, 136, 255, 0.3);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  letter-spacing: 1px;
}

/* Tab Styles */
.tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  position: relative;
}

.tabs::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 136, 255, 0.5), transparent);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  padding: 0.8rem 1.5rem;
  margin: 0 0.5rem;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  letter-spacing: 1px;
}

.tab-btn .icon {
  margin-right: 8px;
  font-size: 1rem;
}

.tab-btn.active {
  color: var(--text-primary);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  box-shadow: 0 0 10px var(--neon-blue), 0 0 20px var(--neon-purple);
  z-index: 1;
}

.tab-btn:hover {
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(0, 136, 255, 0.5);
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Glass Panel Component */
.glass-panel {
  background: rgba(20, 20, 30, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.2),
    0 0 10px rgba(0, 136, 255, 0.1);
  transition: all 0.3s ease;
}

.glass-panel:hover {
  box-shadow: 
    0 4px 30px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(0, 136, 255, 0.2);
}

.glass-panel h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  margin-bottom: 1.2rem;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.neon-accent {
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Input Styles */
.input-group {
  margin-bottom: 1.2rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.glow-input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(10, 10, 20, 0.6);
  border: 1px solid #ccc;
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.glow-input:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(0, 136, 255, 0.3);
}

/* Button Styles */
.neon-button {
  position: relative;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  border: none;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 100%;
  margin-top: 1rem;
}

.neon-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: all 0.5s ease;
}

.neon-button:hover::before {
  left: 100%;
}

.neon-button:hover {
  box-shadow: 
    0 0 10px var(--neon-blue),
    0 0 20px var(--neon-purple);
}

.neon-button-text {
  position: relative;
  z-index: 1;
}

/* Feedback Styles */
.feedback {
  flex: 1;
  font-weight: bold;
  margin-top: 5px;
  font-size: 0.8rem;
}

.valid {
  color: #4caf50;
}

.invalid {
  color: #f44336;
}

/* Converter Tab Styles */
.converter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.result {
  margin-top: 1rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.result-row:last-child {
  border-bottom: none;
}

.result-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.result-value {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
}

.history-panel {
  margin-top: 1.5rem;
}

.history-log {
  height: 200px;
  overflow-y: auto;
  background: rgba(10, 10, 20, 0.4);
  border-radius: 5px;
  padding: 10px;
}

.history-entry {
  padding: 0.6rem;
  margin-bottom: 0.5rem;
  background: rgba(20, 20, 30, 0.6);
  border-radius: 5px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
}

.history-arrow {
  color: var(--neon-purple);
}

/* Enhanced Visualizer Styles */
/* Add these styles to your style.css */
.octet-visualization.horizontal {
  display: flex;
  flex-direction: column;
}

.bit-container.horizontal {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.bit-row.horizontal {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 0;
}

.bit-value.horizontal {
  margin-bottom: 5px;
}

.bit-explanation.horizontal {
  margin-left: 0;
  text-align: center;
  font-size: 0.8rem;
}
.visualizer-grid {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.conversion-type-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.visualizer-btn {
  flex: 1;
  padding: 10px;
  background: rgba(20, 20, 30, 0.6);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.visualizer-btn.active {
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  color: white;
  border-color: var(--neon-purple);
}

.speed-control {
  margin-top: 20px;
}

.speed-control input[type="range"] {
  width: 100%;
  margin-top: 5px;
}

.visualization-container {
  height: 400px;
  overflow-y: auto;
  padding: 15px;
  background: rgba(10, 10, 20, 0.4);
  border-radius: 8px;
}

.octet-visualization {
  margin-bottom: 30px;
}

.octet-header {
  font-family: 'Roboto Mono', monospace;
  margin-bottom: 10px;
  color: var(--neon-blue);
}

.bit-row {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
  align-items: center;
}

.bit-value {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 20, 30, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  font-family: 'Roboto Mono', monospace;
  transition: all 0.3s ease;
}

.bit-value.active {
  background: rgba(0, 136, 255, 0.2);
  border-color: var(--neon-blue);
  box-shadow: 0 0 10px rgba(0, 136, 255, 0.3);
  transform: translateY(-5px);
}

.bit-explanation {
  margin-left: 15px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.steps-container {
  height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.step {
  background: rgba(10, 10, 20, 0.6);
  border-left: 3px solid var(--neon-blue);
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  border-radius: 0 5px 5px 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.step strong {
  color: var(--neon-blue);
}

.result-step {
  background: rgba(0, 136, 255, 0.1);
  border-left-color: var(--neon-purple);
}

.placeholder-message {
  color: var(--text-secondary);
  text-align: center;
  padding: 20px;
  font-style: italic;
}

/* Enhanced Network Simulator Styles */
.network-simulator {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 1.5rem;
  margin-top: 1rem;
}

.sender-panel {
  border-top: 3px solid var(--neon-blue);
}

.receiver-panel {
  border-top: 3px solid var(--neon-purple);
}

.network-visualization {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.network-topology {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 30px 0;
  position: relative;
}

.network-path {
  flex: 1;
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 0 20px;
  position: relative;
  height: 100px;
}

.network-node {
  width: 100px;
  height: 100px;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
}

.sender-node {
  background: rgba(0, 136, 255, 0.1);
  border: 2px solid var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 136, 255, 0.2);
}

.receiver-node {
  background: rgba(160, 0, 255, 0.1);
  border: 2px solid var(--neon-purple);
  box-shadow: 0 0 20px rgba(160, 0, 255, 0.2);
}

.node-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.node-ip {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.3rem 0.6rem;
  border-radius: 10px;
}

.router-icon {
  font-size: 2rem;
  background: rgba(20, 20, 30, 0.6);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--neon-purple);
  box-shadow: 0 0 15px rgba(160, 0, 255, 0.3);
}

.router-label {
  margin-top: 5px;
  font-size: 0.8rem;
  text-align: center;
}

.packet-container {
  position: absolute;
  width: 100%;
  height: 50px;
}

.network-packet {
  position: absolute;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--neon-blue), var(--neon-purple));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: left 0.5s linear;
}

.packet-bits {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.7rem;
  color: white;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.packet-options {
  margin-top: 1rem;
}

.packet-options select {
  width: 100%;
  padding: 8px;
  background: rgba(10, 10, 20, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  color: var(--text-primary);
  margin-top: 5px;
}

.packet-inspector {
  margin-top: 1.5rem;
}

.packet-tabs {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 15px;
}

.packet-tab {
  padding: 8px 15px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
}

.packet-tab.active {
  color: var(--neon-blue);
}

.packet-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--neon-blue);
}

.packet-tab-content {
  display: none;
}

.packet-tab-content.active {
  display: block;
}

.packet-layers {
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  overflow: hidden;
}

.packet-layer {
  border-bottom: 1px solid var(--glass-border);
}

.packet-layer:last-child {
  border-bottom: none;
}

.layer-header {
  background: rgba(20, 20, 30, 0.6);
  padding: 8px 12px;
  font-weight: 500;
  cursor: pointer;
}

.layer-content {
  padding: 12px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  background: rgba(10, 10, 20, 0.4);
  line-height: 1.5;
}

.journey-log {
  height: 200px;
  overflow-y: auto;
  background: rgba(10, 10, 20, 0.4);
  border-radius: 5px;
  padding: 10px;
}

.log-entry {
  padding: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}

.received-message-container {
  margin-top: 1.5rem;
}

.received-message {
  min-height: 120px;
  border: 1px dashed var(--glass-border);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.5rem;
  background: rgba(10, 10, 20, 0.4);
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.message-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.reassembly-status {
  margin-top: 1rem;
}

.progress-bar {
  height: 10px;
  background: rgba(20, 20, 30, 0.6);
  border-radius: 5px;
  margin-top: 5px;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-blue), var(--neon-purple));
  width: 0%;
  transition: width 0.3s ease;
}

/* IPv4 Tools Styles */
.ipv4-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1rem;
}

.tool-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.subnet-results, .ip-info-display, .cheatsheet {
  margin-top: 1rem;
}

.info-row, .cheatsheet-item {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.info-row:last-child, .cheatsheet-item:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.info-value {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9rem;
}

.cs-class {
  font-weight: 500;
  color: var(--neon-blue);
}

.cs-range {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.cheatsheet-item.private .cs-class {
  color: var(--neon-purple);
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .converter-grid, .visualizer-grid, .network-simulator, .ipv4-tools-grid {
    grid-template-columns: 1fr;
  }
  
  .network-topology {
    flex-direction: column;
    height: auto;
  }
  
  .network-path {
    width: 100%;
    margin: 20px 0;
    flex-direction: column;
    height: auto;
  }
}

@media (max-width: 768px) {
  .glass-container {
    padding: 1rem;
  }
  
  .tabs {
    flex-wrap: wrap;
  }
  
  .tab-btn {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    margin: 0.2rem;
  }
}