* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

header {
  background: white;
  padding: 40px 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
  text-align: center;
}

h1 {
  font-size: 2.5rem;
  color: #2c3e50;
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 1.1rem;
  color: #7f8c8d;
  font-weight: 400;
}

h2 {
  font-size: 1.5rem;
  color: #2c3e50;
  margin: 20px 0 15px 0;
  font-weight: 600;
}

h3 {
  font-size: 1.1rem;
  color: #34495e;
  margin: 0 0 15px 0;
  font-weight: 600;
}

p, li {
  font-size: 0.95rem;
  color: #555;
  margin: 10px 0;
}

a {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

a:hover {
  color: #2980b9;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #34495e;
  margin-bottom: 6px;
}

input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-family: inherit;
}

input[type="number"]:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.phasor-form {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.canvas-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  background: #f9f9f9;
  border-radius: 8px;
  padding: 15px;
  border: 1px solid #e8e8e8;
}

canvas {
  border-radius: 6px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.input-section,
.result-section {
  display: flex;
  flex-direction: column;
}

.phasors-display {
  background: #f0f8ff;
  padding: 15px;
  border-radius: 8px;
  border-left: 4px solid #3498db;
  margin-bottom: 20px;
  line-height: 1.8;
  font-size: 0.95rem;
}

.form-group {
  flex: 1;
}

.input-wrapper {
  margin-bottom: 16px;
}

.result-display {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.result-display h3 {
  font-size: 1.3rem;
  margin: 0 0 15px 0;
  font-weight: 600;
  width: 100%;
}

.feedback-correct {
  color: #27ae60;
  text-align: center;
}

.feedback-incorrect {
  color: #e74c3c;
  text-align: center;
}

.result-display table {
  width: 100%;
  margin-top: 15px;
}

button {
  padding: 11px 24px;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-submit {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: white;
  width: 100%;
  padding: 12px 24px;
  margin-top: 10px;
  box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-new {
  background: white;
  color: #3498db;
  border: 2px solid #3498db;
  width: 100%;
  display: block;
  margin-top: 20px;
}

.btn-new:hover {
  background: #3498db;
  color: white;
  box-shadow: 0 2px 4px rgba(52, 152, 219, 0.2);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #ecf0f1;
}

th {
  background: #ecf0f1;
  font-weight: 600;
  color: #2c3e50;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background: #f9f9f9;
}

@media (max-width: 768px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  h1 {
    font-size: 1.8rem;
  }

  body {
    padding: 10px;
  }

  .phasor-form {
    padding: 20px;
  }

  canvas {
    width: 100% !important;
    height: auto !important;
  }
}