@font-face {
  font-family: 'iA Writer Quattro S';
  src: url('/fonts/iAWriterQuattroS-Regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'iA Writer Quattro S';
  src: url('/fonts/iAWriterQuattroS-Bold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'iA Writer Quattro S';
  src: url('/fonts/iAWriterQuattroS-Italic.woff') format('woff');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'iA Writer Quattro S';
  src: url('/fonts/iAWriterQuattroS-BoldItalic.woff') format('woff');
  font-weight: 700;
  font-style: italic;
}

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

body {
  font-family: 'iA Writer Quattro S', -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  color: rgb(39, 39, 39);
  background: rgb(253, 252, 250);
  font-size: 18px;
  font-weight: 400;
}

a {
  color: rgb(39, 39, 39);
  text-decoration: underline;
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.6;
}

/* Layout Structure */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: rgb(253, 252, 250);
  border-right: 1px solid rgba(39, 39, 39, 0.1);
  padding: 2rem 1.5rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 2.5rem;
  display: block;
  color: rgb(39, 39, 39);
  text-decoration: none;
}

.sidebar-brand:hover {
  opacity: 1;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 0.5rem;
}

.sidebar-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: rgb(39, 39, 39);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(39, 39, 39, 0.05);
  opacity: 1;
}

.sidebar-user {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(39, 39, 39, 0.1);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(39, 39, 39, 0.1);
}

.sidebar-user-details {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-handle {
  font-size: 0.8rem;
  color: rgba(39, 39, 39, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 2rem 3rem;
  max-width: 800px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: rgba(39, 39, 39, 0.7);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(39, 39, 39, 0.2);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
  color: rgb(39, 39, 39);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgb(39, 39, 39);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border: 1px solid rgba(39, 39, 39, 0.2);
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  color: rgb(39, 39, 39);
}

.btn:hover {
  background: rgba(39, 39, 39, 0.05);
  opacity: 1;
}

.btn-primary {
  background: rgb(39, 39, 39);
  color: rgb(253, 252, 250);
  border-color: rgb(39, 39, 39);
}

.btn-primary:hover {
  background: rgb(60, 60, 60);
  opacity: 1;
}

button[type="submit"] {
  background: rgb(39, 39, 39);
  color: rgb(253, 252, 250);
  border: 1px solid rgb(39, 39, 39);
  padding: 0.65rem 1.25rem;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

button[type="submit"]:hover {
  background: rgb(60, 60, 60);
}

/* Check-in List */
.checkin-list {
  margin-top: 2rem;
}

.checkin-card {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(39, 39, 39, 0.1);
}

.checkin-card:last-child {
  border-bottom: none;
}

.checkin-emoji {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.checkin-content h3 {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.checkin-address {
  font-size: 0.9rem;
  color: rgba(39, 39, 39, 0.6);
  margin-bottom: 0.5rem;
}

.checkin-note {
  font-style: italic;
  color: rgba(39, 39, 39, 0.8);
  margin: 0.75rem 0;
  padding-left: 1rem;
  border-left: 2px solid rgba(39, 39, 39, 0.15);
}

.checkin-time {
  font-size: 0.85rem;
  color: rgba(39, 39, 39, 0.5);
  margin-top: 0.5rem;
}

.checkin-time a {
  color: rgba(39, 39, 39, 0.5);
  text-decoration: none;
}

.checkin-time a:hover {
  text-decoration: underline;
}

/* Library Cards */
.library-card {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(39, 39, 39, 0.1);
}

.library-card:last-child {
  border-bottom: none;
}

.library-card h3,
.library-card h4 {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.library-card a {
  text-decoration: none;
}

.library-card a:hover {
  text-decoration: underline;
  opacity: 1;
}

.library-address {
  font-size: 0.9rem;
  color: rgba(39, 39, 39, 0.6);
}

/* Autocomplete */
.autocomplete-dropdown,
.autosuggest-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid rgba(39, 39, 39, 0.2);
  border-radius: 4px;
  margin-top: 0.25rem;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.autocomplete-item,
.autosuggest-item {
  padding: 0.75rem;
  cursor: pointer;
  transition: background-color 0.2s;
  border-bottom: 1px solid rgba(39, 39, 39, 0.05);
}

.autocomplete-item:last-child,
.autosuggest-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autosuggest-item:hover {
  background: rgba(39, 39, 39, 0.03);
}

.library-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

/* Empty State */
.empty-state {
  color: rgba(39, 39, 39, 0.5);
  font-size: 0.95rem;
  padding: 2rem 0;
}

/* Messages */
.error {
  color: #c54141;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.loading {
  color: rgba(39, 39, 39, 0.6);
  margin: 1rem 0;
  font-size: 0.9rem;
}

.success {
  color: #51a351;
  margin: 1rem 0;
  font-size: 0.9rem;
}

/* Profile */
.profile-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(39, 39, 39, 0.1);
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(39, 39, 39, 0.1);
}

.profile-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
}

.profile-stat {
  text-align: center;
}

.profile-stat-value {
  font-size: 1.75rem;
  font-weight: 500;
  display: block;
}

.profile-stat-label {
  font-size: 0.85rem;
  color: rgba(39, 39, 39, 0.6);
}

/* Emoji Picker */
.emoji-picker {
  margin-bottom: 1.5rem;
}

.emoji-input {
  font-size: 2rem;
  padding: 0.5rem;
  text-align: center;
  width: 100%;
}

.emoji-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.emoji-btn {
  border: 1px solid rgba(39, 39, 39, 0.2);
  border-radius: 4px;
  font-size: 1.5rem;
  width: 3rem;
  height: 3rem;
  cursor: pointer;
  padding: 0;
  background: white;
  transition: all 0.2s;
}

.emoji-btn:hover {
  background: rgba(39, 39, 39, 0.05);
}

/* Map */
.library-map-container {
  margin: 1.5rem 0;
}

.library-map-container #map {
  width: 100%;
  height: 300px;
  border: 1px solid rgba(39, 39, 39, 0.2);
  border-radius: 4px;
}

/* Selected User */
.selected-user {
  border: 1px solid rgba(39, 39, 39, 0.2);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
}

.selected-user-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.selected-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(39, 39, 39, 0.1);
}

.selected-name {
  font-weight: 500;
}

.selected-handle {
  font-size: 0.85rem;
  color: rgba(39, 39, 39, 0.6);
}

/* Welcome */
.welcome {
  margin: 3rem 0;
}

.welcome h2 {
  margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  
  .main-content {
    margin-left: 0;
    padding: 1.5rem;
  }
  
  body {
    font-size: 16px;
  }
}