/* Christmas Theme for Visual Networking Challenge */

/* Background and general styling */
body {
  background-color: #0a3142;
  background-image: url('https://www.transparenttextures.com/patterns/snow.png');
  color: #f0f0f0;
}

.app-container {
  background-color: rgba(15, 50, 65, 0.9);
  border: 2px solid #2e8b57;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* Header styling */
.header {
  position: relative;
}

.header h1 {
  color: #e4393c;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  font-family: 'Mountains of Christmas', cursive, Arial, sans-serif;
  font-size: 2.5em;
}

.header h1::before, .header h1::after {
  content: '🎄';
  margin: 0 15px;
}

/* Challenge section styling */
.challenge-section {
  background-color: rgba(25, 60, 75, 0.9);
  border: 1px solid #2e8b57;
  box-shadow: 0 0 10px rgba(46, 139, 87, 0.3);
}

.challenge-section h2 {
  color: #e4393c;
  border-bottom: 2px dotted #2e8b57;
}

.challenge-section.disabled::after {
  background-color: rgba(10, 30, 40, 0.8);
  content: "❄️ Complete the previous challenge to unlock ❄️";
}

/* Simulator styling */
.client-container, .server-container, .tcp-panel {
  background-color: rgba(20, 55, 70, 0.9);
  border: 1px solid #2e8b57;
}

.client-container h3, .server-container h3, .tcp-panel h3 {
  color: #e4393c;
  border-bottom: 1px dotted #2e8b57;
}

/* Improve DNS, HTTP, and HTTPS section headings */
.dns-part h4, .http-part h4, .https-part h4 {
  color: #fff;
  background-color: rgba(46, 139, 87, 0.7);
  padding: 8px;
  border-radius: 4px;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
  margin-top: 0;
  text-align: center;
  font-size: 1.1em;
}

.dns-part, .http-part, .https-part {
  background-color: rgba(25, 60, 75, 0.9);
  border: 1px solid #1a6840;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

/* Form styling */
.dns-input, .http-input, .https-input {
  background-color: rgba(15, 45, 60, 0.9);
  border: 1px solid #2e8b57;
  color: #f0f0f0;
}

/* Improve form labels */
.form-group label {
  color: #fff;
  font-weight: bold;
  margin-bottom: 5px;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

select option {
  background-color: #0a3142;
}

/* Improve readability for various elements */
/* Server IP display - Challenge 2 */
.server-ip-display {
  background-color: rgba(15, 45, 60, 0.8);
  border: 2px solid #2e8b57;
  color: #ffffff;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

/* TCP Flags - Challenge 2 */
.packet-palette {
  background-color: rgba(15, 45, 60, 0.8);
  border: 1px solid #2e8b57;
}

/* Input fields with readonly attributes - Challenge 3 & 5 */
.http-input[readonly], .https-input[readonly] {
  background-color: rgba(15, 45, 60, 0.8);
  color: #ffffff;
  border-color: #2e8b57;
}

/* Response preview areas - Challenge 3, 4, 5 */
.http-response-preview, .https-response-preview {
  background-color: rgba(15, 45, 60, 0.8);
  color: #ffffff;
  border: 1px solid #2e8b57;
}

.http-response-content, .https-response-content {
  color: #ffffff;
}

/* Result display areas - All challenges */
.dns-result, .http-result, .tls-result, .https-result {
  background-color: rgba(15, 45, 60, 0.8);
  color: #ffffff;
  border: 1px solid #2e8b57;
}

/* Preview images in HTTPS response */
.https-preview-image {
  border: 2px solid #2e8b57;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* TLS palette */
.tls-palette {
  background-color: rgba(15, 45, 60, 0.8);
  border: 1px solid #2e8b57;
}

/* TLS Challenge Specific Styles */
.tls-handshake-container {
  background-color: rgba(20, 55, 70, 0.9);
  border: 1px solid #2e8b57;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

/* Button styling */
.dns-submit-button, .http-submit-button, .https-submit-button {
  background-color: #e4393c;
  border: 2px solid #fff;
  box-shadow: 0 0 5px rgba(255,255,255,0.3);
}

.dns-submit-button:hover, .http-submit-button:hover, .https-submit-button:hover {
  background-color: #c9302c;
}

.reset-button {
  background-color: #2e8b57;
  border: 2px solid #fff;
}

.reset-button:hover {
  background-color: #1a6840;
}

/* TCP & TLS Packet Styling */
.packet, .tls-message {
  box-shadow: 0 0 5px rgba(255,255,255,0.3);
}

.packet.SYN {
  background-color: #e4393c;
}

.packet.ACK {
  background-color: #2e8b57;
}

.connection-slot, .tls-slot {
  background-color: rgba(15, 45, 60, 0.7);
  border: 2px dashed #2e8b57;
}

.connection-slot.over, .tls-slot.over {
  border-color: #e4393c;
  background-color: rgba(228, 57, 60, 0.2);
}

/* TLS slot styling */
.tls-slot {
  background-color: rgba(15, 45, 60, 0.8);
}

.tls-slot .slot-placeholder {
  color: #fff;
  opacity: 0.8;
}

/* Connection slots */
.connection-slot {
  background-color: rgba(15, 45, 60, 0.8);
}

.connection-slot .slot-placeholder, .tls-slot .slot-placeholder {
  color: #fff;
  opacity: 0.8;
  font-weight: bold;
}

/* Success styling */
.challenge-complete {
  color: #2e8b57;
  font-weight: bold;
}

.completed {
  border-left: 4px solid #e4393c !important;
  background-color: rgba(46, 139, 87, 0.2) !important;
}

.dns-simulator.completed, .tcp-simulator.completed, .http-simulator.completed,
.tls-simulator.completed, .https-simulator.completed {
  background-image: url('https://www.transparenttextures.com/patterns/christmas-paper.png');
}

.tcp-success-message, .tls-success-message, .https-success-message {
  background-color: rgba(46, 139, 87, 0.3);
  border-left: 4px solid #e4393c;
}

/* Victory styling */
#victory-container {
  position: relative;
  overflow: hidden;
}

.victory {
  background-color: rgba(46, 139, 87, 0.3);
  border: 2px solid #e4393c;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  animation: snow-bg 20s linear infinite;
}

.victory h3 {
  color: #e4393c;
  font-family: 'Mountains of Christmas', cursive, Arial, sans-serif;
  font-size: 2em;
  margin-bottom: 15px;
}

.victory h3::before, .victory h3::after {
  content: '🎅';
  margin: 0 10px;
}

#victory-token {
  margin-top: 20px;
  padding: 10px;
  background-color: rgba(10, 30, 40, 0.7);
  border-radius: 5px;
  font-family: monospace;
}

/* Hint styling */
.hint {
  background-color: rgba(228, 57, 60, 0.2);
  border-left: 4px solid #e4393c;
}

/* Improve link contrast in hint sections */
.hint a {
  color: #f0f0c0; /* Light yellow color for better contrast */
  font-weight: bold;
  text-decoration: underline;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
}

.hint a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Network middle */
.network-middle .arrow {
  color: #e4393c;
  font-size: 28px;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.tls-flow-indicator {
  color: #fff;
  background-color: rgba(46, 139, 87, 0.5);
  padding: 5px;
  border-radius: 4px;
  text-align: center;
}

/* Footer styling */
footer {
  color: #b5d1dd;
  text-align: center;
  margin-top: 30px;
  padding: 10px;
  position: relative;
}

footer::before {
  content: '❄️';
  margin-right: 10px;
}

footer::after {
  content: '❄️';
  margin-left: 10px;
}

/* Snow Animation */
.snowflake {
  color: #fff;
  font-size: 1em;
  font-family: Arial, sans-serif;
  text-shadow: 0 0 4px #fff;
  position: fixed;
  top: -10%;
  z-index: 9999;
  user-select: none;
  animation: fall 10s linear infinite;
}

@keyframes fall {
  0% {
    opacity: 0;
  }
  3% {
    opacity: 0.9;
  }
  90% {
    opacity: 0.9;
  }
  100% {
    transform: translate(0, 97vh);
    opacity: 0;
  }
}

@keyframes snow-bg {
  0% { background-position: 0 0; }
  100% { background-position: 500px 500px; }
}
