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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

#app {
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  font-size: 1.3rem;
  font-weight: 600;
}

.icon-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s;
}

.icon-btn:hover {
  background: rgba(255,255,255,0.3);
}

.info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: #f0f4f8;
  font-size: 0.9rem;
  color: #555;
  border-bottom: 1px solid #e0e0e0;
}

.main-content {
  padding: 1rem;
}

.record-form {
  background: #fff;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 500;
  flex: 1;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.primary {
  background: #667eea;
  color: white;
}

.primary:hover:not(:disabled) {
  background: #5a67d8;
  transform: translateY(-2px);
}

.secondary {
  background: #e0e7ff;
  color: #4c51bf;
}

.secondary:hover:not(:disabled) {
  background: #c7d2fe;
}

.save-btn {
  background: #10b981;
  color: white;
  width: 100%;
  margin-top: 1rem;
}

.save-btn:hover:not(:disabled) {
  background: #059669;
}

.voice-btn {
  background: #f59e0b;
  color: white;
}

.voice-btn:hover:not(:disabled) {
  background: #d97706;
}

.voice-btn.recording {
  background: #ef4444;
  animation: pulse 1.5s infinite;
}

.export-btn {
  background: #8b5cf6;
  color: white;
  margin-bottom: 0.5rem;
  width: 100%;
}

.export-btn:hover:not(:disabled) {
  background: #7c3aed;
}

.toggle-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 26px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #667eea;
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.label-text {
  font-size: 0.9rem;
  color: #555;
}

.photo-preview {
  margin: 1rem 0;
  border-radius: 8px;
  overflow: hidden;
}

.photo-preview img {
  width: 100%;
  display: block;
}

.photo-thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.photo-thumb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb .remove-photo {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.record-images {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.record-images .record-image {
  width: 100%;
  border-radius: 8px;
}

.description-area {
  margin-top: 1rem;
}

#description-input {
  width: 100%;
  min-height: 100px;
  padding: 0.8rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  resize: vertical;
  transition: border-color 0.3s;
}

#description-input:focus {
  outline: none;
  border-color: #667eea;
}

.voice-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.8rem;
}

.voice-status {
  font-size: 0.85rem;
  color: #666;
}

.records-list {
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.1rem;
  color: #333;
  margin-bottom: 1rem;
  padding-left: 0.5rem;
  border-left: 4px solid #667eea;
}

.records-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.no-records {
  text-align: center;
  color: #999;
  padding: 2rem;
}

.record-item {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1rem;
  position: relative;
  border: 1px solid #e9ecef;
}

.record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.record-time {
  font-size: 0.8rem;
  color: #888;
}

.record-actions {
  display: flex;
  gap: 0.5rem;
}

.edit-btn, .delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.edit-btn:hover {
  background: #e0e7ff;
}

.delete-btn:hover {
  background: #fee2e2;
}

.record-image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 0.8rem;
}

.record-description {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.5;
}

.export-section {
  padding: 1rem 0;
  border-top: 1px solid #e0e0e0;
}

.records-count {
  text-align: center;
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.5rem;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
}

.modal-content h2 {
  margin-bottom: 1.5rem;
  color: #333;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #555;
}

.form-group input {
  width: 100%;
  padding: 0.8rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
}

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

.modal-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  font-size: 0.9rem;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.1rem;
  }
  
  .info-bar {
    font-size: 0.8rem;
    gap: 0.5rem;
  }
  
  .btn {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
  }
}
