div.gallery {
  margin: 5px;
  border: 2px outset #ece9d8;
  float: right;
  width: 200px;
  background: white;
  padding: 3px;
  transition: all 0.2s ease;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

div.gallery:hover {
  border: 2px inset #316ac5;
  background: #e3f2fd;
  box-shadow: inset 0 0 5px rgba(49, 106, 197, 0.3), 2px 2px 5px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

div.gallery:active {
  transform: translateY(0);
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.3);
}

div.gallery img {
  width: 100%;
  height: auto;
  border: 1px solid #c0c0c0;
  transition: border-color 0.2s ease;
}

div.gallery:hover img {
  border-color: #316ac5;
}

div.gallery .desc {
  padding: 5px;
  text-align: center;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  background: linear-gradient(to bottom, #f8f8f8 0%, #f0f0f0 100%);
  border-top: 1px solid #c0c0c0;
  margin-top: 2px;
}

/* Gallery Explorer Styles */
.gallery-explorer {
  border: 2px inset #c0c0c0;
  background: white;
  margin: 10px 0;
}

.gallery-toolbar {
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  padding: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.address-bar {
  background: white;
  border: 1px inset #c0c0c0;
  padding: 2px 5px;
  flex-grow: 1;
  font-family: monospace;
}

.toolbar-button {
  background: #c0c0c0;
  border: 1px outset #c0c0c0;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 11px;
}

.toolbar-button:active {
  border: 1px inset #c0c0c0;
}

.toolbar-button:hover {
  background: #d0d0d0;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  padding: 15px;
  background: white;
  min-height: 200px;
}

.image-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.image-item:hover {
  background: #e0e0ff;
  border: 1px dotted #0000ff;
  transform: translateY(-2px);
}

.image-thumbnail {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border: 1px solid #808080;
  margin-bottom: 5px;
  transition: all 0.3s ease;
}

.image-thumbnail:hover {
  border-color: #0000ff;
}

.image-name {
  font-size: 11px;
  word-break: break-word;
  max-width: 120px;
  margin-bottom: 2px;
}

.image-size {
  font-size: 9px;
  color: #666;
}

/* List view styles */
.image-list {
  background: white;
  padding: 0;
  border-top: 1px solid #c0c0c0;
}

.list-item {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.list-item:hover {
  background: #e0e0ff;
}

.list-icon {
  width: 20px;
  text-align: center;
  margin-right: 8px;
}

.list-name {
  flex-grow: 1;
  font-size: 12px;
  margin-right: 10px;
}

.list-size {
  font-size: 10px;
  color: #666;
  min-width: 60px;
  text-align: right;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-style: italic;
}

.loading.progress {
  background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
              linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
              linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
              linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  animation: move 1s linear infinite;
}

@keyframes move {
  0% { background-position: 0 0, 0 10px, 10px -10px, -10px 0px; }
  100% { background-position: 20px 20px, 20px 30px, 30px 10px, 10px 20px; }
}

.cache-info {
  font-size: 10px;
  color: #888;
  margin-top: 5px;
  text-align: center;
}

.thumbnail-error {
  background: #ffe6e6;
  border: 1px solid #ffcccc;
  color: #cc0000;
  padding: 2px 4px;
  border-radius: 2px;
  font-size: 9px;
}