* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
}

.container {
  display: flex;
  max-width: 1600px;
  min-width: 1100px;
  width: 100%;
  margin: 0 auto;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
  border-radius: 15px;
  overflow: hidden;
  background: white;
  min-height: 85vh;
  color: #2d3748;
}

header {
  max-width: 1600px;
  min-width: 1100px;
  width: 100%;
  margin: 20px auto;
  text-align: center;
  color: #333;
  position: relative;
  overflow: hidden;
  color: #2d3748;
}

header h1 {
  font-size: 2rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 2;
}

header p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.6;
  opacity: 0.9;
  position: relative;
  z-index: 2;
}

.control-panel {
  width: 330px;
  background: linear-gradient(to bottom, #2c3e50, #1a2530);
  color: white;
  padding: 15px;
  overflow-y: auto;
  border-right: 1px solid #34495e;
  position: relative;
}

.ruler-display {
  flex: 1;
  padding: 15px;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  position: relative;
}

.form-group {
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.form-group:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.form-group select,.form-group input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #3a506b;
  background: rgba(26, 39, 56, 0.8);
  color: white;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group select:focus, .form-group input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.form-group input[type="color"] {
  height: 50px;
  padding: 5px;
  cursor: pointer;
}

.btn-group {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

button {
  flex: 1;
  padding: 15px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#applyBtn {
  background: linear-gradient(to right, #3498db, #2980b9);
  color: white;
}

#fullscreenBtn {
  background: linear-gradient(to right, #27ae60, #219653);
  color: white;
}

#resetBtn {
  background: linear-gradient(to right, #e74c3c, #c0392b);
  color: white;
}

#downloadBtn {
  background: linear-gradient(to right, #9b59b6, #8e44ad);
  color: white;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

button:active {
  transform: translateY(1px);
}

.info-box {
  background: rgba(26, 39, 56, 0.8);
  border-radius: 12px;
  padding: 10px;
  margin-top: 20px;
  border: 1px solid #3a506b;
}

.info-box h3 {
  margin-bottom: 15px;
  color: #3498db;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-content {
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.85;
}

.info-content p {
  margin-bottom: 12px;
  padding-left: 5px;
  border-left: 2px solid #3498db;
  padding-left: 10px;
}

.ruler-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 15px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  overflow: auto;
  padding: 25px;
  border: 1px solid #e2e8f0;
  position: relative;
}

#rulerSvg {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  background: white;
}

.display-info {
  display: flex;
  justify-content: space-between;
  background: linear-gradient(to right, #e3f2fd, #bbdefb);
  padding: 18px 25px;
  border-radius: 12px;
  margin-bottom: 30px;
  font-weight: 600;
  color: #2c3e50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-size: 1.1rem;
}

.display-info div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.display-info span {
  color: #3498db;
  font-weight: 700;
  min-width: 100px;
  display: inline-block;
}

.instructions {
  background: linear-gradient(to right, #e3f2fd, #d1e7ff);
  padding: 25px;
  border-radius: 12px;
  margin-top: 25px;
  font-size: 1.05rem;
  line-height: 1.75;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.instructions h3 {
  margin-bottom: 20px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1.4rem;
}

.footer {
  text-align: center;
  padding: 25px;
  color: #7f8c8d;
  border-top: 1px solid #eaeef2;
}


@media (max-width: 1100px) {
  .container {
    flex-direction: column;
  }

  .control-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #34495e;
  }

  .btn-group {
    flex-wrap: wrap;
  }

  .btn-group button {
    min-width: 200px;
  }
}

.ruler-edge {
  position: absolute;
  top: 0;
  width: 15px;
  height: 100%;
  background: #f8f9fa;
  z-index: 10;
}

.ruler-edge.left {
  left: 0;
  border-right: 2px solid #e74c3c;
}

.ruler-edge.right {
  right: 0;
  border-left: 2px solid #e74c3c;
}

.highlight {
  animation: highlight 1.5s ease;
}

@keyframes highlight {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(52, 152, 219, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
  }
}
