/* Notes App Frontend Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

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

.header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 10px;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.card {
  background: white;
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.card h2 {
  color: #667eea;
  margin-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}

.card h3 {
  color: #555;
  margin-bottom: 15px;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 2px solid #e0e0e0;
  border-radius: 5px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #666;
  font-size: 12px;
}

.error-message {
  display: block;
  margin-top: 5px;
  color: #dc3545;
  font-size: 12px;
  font-weight: 500;
  min-height: 16px;
}

.form-group textarea {
  height: 100px;
  resize: vertical;
}

button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-right: 10px;
  margin-bottom: 10px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: #6c757d;
}

.btn-danger {
  background: #dc3545;
}

.btn-success {
  background: #28a745;
}

.btn-warning {
  background: #ffc107;
  color: #333;
}

.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
  font-weight: 500;
}

.alert-success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.notes-list {
  display: grid;
  gap: 15px;
  margin-top: 20px;
}

.note-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.note-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.note-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.note-content {
  color: #666;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

.note-tags {
  margin-bottom: 10px;
}

.tag {
  display: inline-block;
  background: #667eea;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  margin-right: 5px;
  margin-bottom: 5px;
}

.note-meta {
  font-size: 12px;
  color: #999;
  margin-bottom: 10px;
}

.note-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.note-actions button {
  padding: 5px 10px;
  font-size: 12px;
  margin: 0;
}

.edit-form {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  border: 2px solid #667eea;
}

.edit-form h4 {
  margin-bottom: 15px;
  color: #667eea;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.form-actions button {
  margin: 0;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.controls .form-group {
  margin-bottom: 10px;
}

.api-tests {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.test-group {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.test-group h3 {
  margin-bottom: 10px;
  color: #495057;
}

.test-group button {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  font-size: 12px;
  padding: 8px 12px;
}

#responseLog {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 5px;
  padding: 15px;
  max-height: 400px;
  overflow-y: auto;
  font-family: "Courier New", monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.log-entry {
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 3px;
  border-left: 3px solid #667eea;
}

.log-entry.success {
  background: #d4edda;
  border-left-color: #28a745;
}

.log-entry.error {
  background: #f8d7da;
  border-left-color: #dc3545;
}

.log-entry.info {
  background: #d1ecf1;
  border-left-color: #17a2b8;
}

.loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

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

.hidden {
  display: none !important;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.stat-card {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid #e9ecef;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #667eea;
}

.stat-label {
  color: #666;
  font-size: 14px;
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .api-tests {
    grid-template-columns: 1fr;
  }

  .note-actions {
    flex-direction: column;
  }

  .note-actions button {
    width: 100%;
  }
}
