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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
}

h2 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.timer-section {
    text-align: center;
    margin-bottom: 30px;
}

.timer-display {
    font-size: 4em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.timer-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-start {
    background-color: #4CAF50;
    color: white;
}

.btn-start:hover:not(:disabled) {
    background-color: #45a049;
}

.btn-stop {
    background-color: #f44336;
    color: white;
}

.btn-stop:hover:not(:disabled) {
    background-color: #da190b;
}

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

.input-section {
    margin-bottom: 30px;
}

.input-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#taskDescription {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    font-family: inherit;
    resize: vertical;
}

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

.voice-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.btn-voice:hover {
    background-color: #5568d3;
}

#voiceStatus {
    color: #666;
    font-size: 0.9em;
}

.category-section {
    margin-bottom: 30px;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.category-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background-color: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.95em;
}

.category-btn:hover {
    background-color: #667eea;
    color: white;
}

.category-btn.selected {
    background-color: #667eea;
    color: white;
}

.selected-category {
    padding: 10px;
    background-color: #f0f0f0;
    border-radius: 5px;
    min-height: 40px;
    display: flex;
    align-items: center;
    color: #333;
}

.records-section {
    margin-top: 30px;
}

.records-list {
    max-height: 400px;
    overflow-y: auto;
}

.record-item {
    background-color: #f9f9f9;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid #667eea;
}

.record-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.record-category {
    background-color: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85em;
}

.record-time {
    color: #666;
    font-size: 0.9em;
}

.record-description {
    color: #333;
    margin-top: 5px;
}

.record-duration {
    color: #4CAF50;
    font-weight: bold;
    font-size: 0.9em;
    margin-top: 5px;
}

.record-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.record-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.record-info {
    display: flex;
    flex-direction: column;
}

.btn-edit, .btn-delete {
  background-color: #f5f5f5;
  border: none;
  font-size: 18px;
  cursor: pointer;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-edit:hover {
  background-color: #4CAF50;
  color: white;
}

.btn-delete:hover {
  background-color: #f44336;
  color: white;
}

/* モーダル */
.edit-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 20px;
  border-radius: 12px;
  width: 300px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.modal-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.btn-save {
  background-color: #4CAF50;
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
}

.btn-cancel {
  background-color: #ccc;
  padding: 6px 12px;
  border-radius: 6px;
  border: none;
}


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

.error {
    background-color: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

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