/* Base Styles */
body {
  margin: 0;
  padding: 0;
  background: #121212;
  color: #eee;
  font-family: 'Roboto', sans-serif;
}

.hidden { display: none !important; }
.centered {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

/* App Container */
#app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.header button {
  background: #2196f3;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.header button:hover {
  background: #1976d2;
}

#sortFilter {
  margin-top: 1rem;
  padding: 0.4rem;
  border-radius: 4px;
  border: none;
  background: #222;
  color: #eee;
  font-size: 0.9rem;
}

/* Main Body */
#app-body {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Contacts List */
#contacts-list {
  flex: 1;
  max-width: 350px;
}

.contact-card {
  background: #1e1e1e;
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.card-info {
  width: 100%;
}

.card-info h2 {
  margin: 0;
  font-size: 1.1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-indicator {
  font-size: 0.9rem;
  color: #bbb;
  margin-left: 0.5rem;
}

.progress-bar {
  background: #444;
  border-radius: 6px;
  height: 10px;
  overflow: hidden;
  margin: 0.6rem 0 0.8rem 0;
}

.progress-fill {
  height: 100%;
  transition: width 0.3s ease;
  background: #777;
}

.progress-fill.green { background: #8bc34a; }
.progress-fill.red { background: #f44336; }

.card-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.card-buttons button {
  background: #333;
  color: #eee;
  border: none;
  border-radius: 6px;
  padding: 0.6rem;
  cursor: pointer;
  font-weight: 600;
  flex: 1;
  text-align: center;
  transition: background 0.2s;
}

.card-buttons button:hover { background: #555; }
.card-buttons button.positive { background: #4caf50; }
.card-buttons button.negative { background: #f44336; }
.card-buttons button.comment { background: #2196f3; }
.card-buttons button.delete { background: #888; }
.card-buttons button.delete:hover { background: #666; }

/* Notes Section */
#notes-section {
  flex: 1.2;
  background: #1e1e1e;
  border-radius: 8px;
  padding: 1rem;
  display: none;
  flex-direction: column;
  gap: 0.8rem;
}

/* Lighter title color for notes header */
#notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ccc;
}

#notes-header button {
  background: transparent;
  border: none;
  color: #bbb;
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}

#notes-header button:hover { color: #fff; }

#note-input-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#note-textarea {
  resize: none;
  height: 60px;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #555;
  background: #222;
  color: #eee;
  font-size: 0.9rem;
}

#error-msg {
  color: #ff5555;
  font-size: 0.8rem;
  display: none;
}

#record-note-btn {
  align-self: flex-start;
  background: #2196f3;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

#record-note-btn:hover { background: #1976d2; }

#notes-list {
  overflow-y: auto;
  flex-grow: 1;
  background: #222;
  border-radius: 6px;
  padding: 0.5rem;
  box-sizing: border-box;
}

.note-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.note-text {
  flex-grow: 1;
  background: #111;
  color: #eee;
  border: none;
  resize: none;
  font-size: 0.9rem;
  padding: 0.4rem;
  border-radius: 4px;
  margin-right: 0.4rem;
  font-family: 'Roboto', sans-serif;
}

.note-meta {
  font-size: 0.75rem;
  color: #aaa;
  margin-right: 0.4rem;
  min-width: 100px;
  text-align: right;
  white-space: nowrap;
}

.note-actions button {
  background: transparent;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  margin-left: 0.3rem;
}

.note-actions button:hover { color: #fff; }

/* Modal for New Contact */
.modal-hidden { display: none !important; }
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.modal-content {
  background: #1e1e1e;
  padding: 1rem;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-sizing: border-box;
  color: #eee;
}

.modal-content h2 { margin-top: 0; }
.modal-content input {
  width: 100%;
  padding: 0.6rem;
  border: none;
  border-radius: 6px;
  margin-bottom: 1rem;
  background: #222;
  color: #eee;
  font-size: 1rem;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
}

.modal-buttons button {
  background: #4caf50;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-weight: 600;
  margin-left: 0.5rem;
}

.modal-buttons .close-btn { background: #f44336; }

.modal-buttons button:hover { filter: brightness(1.1); }

/* Scrollbar styling */
#notes-list::-webkit-scrollbar { width: 6px; }
#notes-list::-webkit-scrollbar-track { background: #1e1e1e; }
#notes-list::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
