/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background-color: #f5f7fa;
  color: #222;
  text-align: center;
  line-height: 1.6;
}

/* Header styles */
header {
  background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), linear-gradient(to right, #1a73e8, #8e44ad) !important;
  background-color: #1a73e8;
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 60px 20px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

header h1 {
  font-size: 3em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
}

header p {
  font-size: 1.3em;
  margin-top: 10px;
  opacity: 0.9;
}

/* Main content styles */
main {
  max-width: 900px;
  margin: 30px auto;
  padding: 30px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

h2 {
  font-size: 2em;
  font-weight: 600;
  margin-bottom: 20px;
  color: #1a73e8;
}

/* Search section styles */
#search-section {
  margin-bottom: 40px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
}

.search-container {
  display: flex;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
}

#search-input {
  flex: 1;
  padding: 10px;
  font-size: 1.1em;
  border: 2px solid #1a73e8;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.3s;
}

#search-input:focus {
  border-color: #0d47a1;
}

#search-button {
  padding: 10px 20px;
  font-size: 1.1em;
  background-color: #1a73e8;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#search-button:hover {
  background-color: #0d47a1;
}

.search-results {
  list-style: none;
  padding: 10px;
  background: #fff;
  border: 2px solid #1a73e8;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
  position: absolute;
  width: calc(100% - 20px);
  min-width: 280px; /* Fix for small screens */
  max-width: 580px;
  margin: 0 auto;
  left: 0;
  right: 0;
  z-index: 10;
  display: none;
}

.search-results li {
  margin: 8px 0;
  font-size: 1.1em;
  font-weight: 500;
  color: #000;
  padding: 8px;
  border-left: 4px solid #1a73e8;
  background: #fff;
  border-radius: 4px;
  transition: transform 0.3s, background-color 0.3s;
}

.search-results li:hover {
  transform: translateX(5px);
  background-color: #e6f0ff;
}

.search-results li a {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  padding: 0 28px 0 12px;
  position: relative;
}

.search-results li a img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 10px;
  border: 1px solid #ddd;
}

.search-results li a.no-image::before {
  content: '📷';
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-size: 16px;
  color: #fff;
  background-color: #333;
  border-radius: 50%;
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: Arial, sans-serif;
}

.search-results li a::after {
  content: '\2713';
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  background-color: #1a73e8;
  border-radius: 50%;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

/* Recent views styles */
#recent-views {
  margin-top: 40px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 8px;
}

#recent-views h2 {
  font-size: 1.8em;
}

#recent-views ul {
  list-style: none;
  padding: 0;
}

#recent-views li {
  margin: 12px 0;
  font-size: 1.2em;
  font-weight: 500;
  color: #000;
  padding: 10px;
  border-left: 4px solid #1a73e8;
  background: #fff;
  border-radius: 4px;
  transition: transform 0.3s, background-color 0.3s, opacity 0.3s; /* Shorten for mobile */
  opacity: 1;
}

#recent-views li a {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  padding: 0 28px 0 12px;
  position: relative;
}

#recent-views li a img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 10px;
  border: 1px solid #ddd;
}

#recent-views li a.no-image::before {
  content: '📷';
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  font-size: 16px;
  color: #fff;
  background-color: #333;
  border-radius: 50%;
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: Arial, sans-serif;
}

#recent-views li a.no-image:not([data-emoji-support])::before {
  content: 'I';
  font-size: 14px;
  font-weight: bold;
}

#recent-views li a::after {
  content: '\2713';
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  background-color: #1a73e8;
  border-radius: 50%;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
}

#recent-views li:hover {
  transform: translateX(5px);
  background-color: #e6f0ff;
}

/* Animations */
#recent-views li.enter {
  animation: slideUpItem 0.3s ease-out; /* Shorten for mobile */
}

#recent-views li.exit {
  animation: fadeOutItem 0.3s ease-out forwards; /* Shorten for mobile */
}

@keyframes slideUpItem {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeOutItem {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-20px); }
}

/* Responsive design */
@media (max-width: 768px) {
  header h1 {
    font-size: 2.2em;
  }
  header p {
    font-size: 1.1em;
  }
  main {
    margin: 15px;
    padding: 20px;
  }
  .search-container {
    flex-direction: column;
    gap: 5px;
  }
  #search-input, #search-button {
    width: 100%;
  }
  .search-results {
    width: calc(100% - 20px);
    min-width: 280px; /* Fix for small screens */
  }
}