/* style.css */
:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --light-gray: #ecf0f1;
  --dark-gray: #7f8c8d;
  --white: #ffffff;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f7fa;
  padding: 20px;
  position: relative;
  min-height: 100vh;
  padding-bottom: 60px; /* Space for footer */
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--light-gray);
}

.header h1 {
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 10px;
}

.header p {
  color: var(--dark-gray);
  font-weight: 300;
}

.app-container {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.control-panel {
  flex: 1;
  min-width: 300px;
  background: var(--white);
  padding: 25px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.preview-panel {
  flex: 2;
  min-width: 400px;
  background: var(--white);
  padding: 25px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--primary-color);
}

input, select {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid var(--light-gray);
  border-radius: 4px;
  font-size: 16px;
  transition: border 0.3s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 25px;
}

button {
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 120px;
}

.btn-primary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: var(--primary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: #1a252f;
}

.btn-accent {
  background-color: var(--accent-color);
  color: white;
}

.btn-accent:hover {
  background-color: #c0392b;
}

.preview-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  position: relative;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, 2.2cm);
  grid-template-rows: repeat(4, 2.2cm);
  grid-gap: 0.1cm;
  border: 2px dashed var(--dark-gray);
  padding: 10px;
  box-sizing: border-box;
}

canvas {
  width: 100%;
  height: 100%;
  border: 1px solid var(--light-gray);
  transition: transform 0.2s ease;
}

canvas:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.status-message {
  margin-top: 20px;
  padding: 10px;
  border-radius: 4px;
  text-align: center;
  font-weight: 500;
}

.success {
  background-color: rgba(46, 204, 113, 0.2);
  color: #27ae60;
}

.error {
  background-color: rgba(231, 76, 60, 0.2);
  color: #c0392b;
}

.footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 20px;
  color: var(--dark-gray);
  font-size: 14px;
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  
  .control-panel, .preview-panel {
    min-width: 100%;
  }
  
  .matrix-grid {
    grid-template-columns: repeat(4, 1.5cm);
    grid-template-rows: repeat(4, 1.5cm);
  }
}