/* Base/Default theme variables */
:root {
  --primary-color: #333;
  --secondary-color: #666;
  --bg-color: #ffffff;
  --text-color: #333;
  --text-secondary: #666;
  --border-color: #ddd;
  --accent-color: #007acc;
  --hover-bg: #f5f5f5;
}

* {
  box-sizing: border-box;
}

/* Base body styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background: #f8f9fa;
  color: var(--text-color, #333);
  overflow-x: hidden;
  transition: all 0.3s ease;
}

/* Theme selector */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0;
}

.theme-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-label {
  font-size: 0.9em;
  color: var(--text-secondary, #666);
  font-weight: 500;
}

.theme-dropdown {
  background: var(--bg-color, #ffffff);
  color: var(--text-color, #333);
  border: 1px solid var(--border-color, #ddd);
  padding: 8px 16px;
  font-family: inherit;
  font-size: 0.9em;
  cursor: pointer;
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
  padding-right: 35px;
}

.theme-dropdown:hover {
  background-color: var(--hover-bg, #f5f5f5);
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background-color: rgba(255, 255, 255, 0.9);
  color: #2c3e50;
  text-decoration: none;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.back-link a:hover {
  background-color: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 40px 40px;
  position: relative;
  z-index: 3;
}

.header-section {
  text-align: center;
  margin-bottom: 40px;
}

h1 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: clamp(2.5rem, 8vw, 3rem);
  font-weight: 700;
  color: var(--text-color, #333);
  margin: 0;
  letter-spacing: -1px;
  position: relative;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: var(--accent-color, #007acc);
  display: none;
}

.subtitle {
  margin: 8px;
  color: var(--text-secondary, #666);
  font-size: 1.1em;
  font-weight: 400;
  opacity: 0.9;
}

/* Archive Grid Styles */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  padding: 0;
  list-style: none;
}

.archive-item {
  background: var(--bg-color, #ffffff);
  border: 1px solid var(--border-color, #ddd);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.archive-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.archive-item a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.image-container {
  position: relative;
  overflow: hidden;
  height: 180px;
  background: var(--hover-bg, #f8f8f8);
}

.screenshot-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.05);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.archive-item:hover .image-overlay {
  opacity: 1;
}

.year-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #33333394;
  color: white;
  padding: 2px 8px;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 4px;
}

.item-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-color, #ffffff);
}

.item-title {
  font-family: inherit;
  font-size: 1.3em;
  font-weight: 600;
  color: var(--text-color, #333);
  margin-bottom: 12px;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.archive-item:hover .item-title {
  color: var(--accent-color, #007acc);
}

.item-description {
  color: var(--text-secondary, #666);
  font-size: 0.9em;
  font-weight: 400;
  line-height: 1.5;
  flex-grow: 1;
  margin-bottom: 16px;
}

.access-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-color, #007acc);
  font-size: 0.85em;
  font-weight: 500;
  margin-top: auto;
}

.access-indicator::before {
  content: '→';
  font-size: 1.1em;
  transition: transform 0.3s ease;
}

.archive-item:hover .access-indicator::before {
  transform: translateX(3px);
}

/* Responsive Styles */
@media (max-width: 1200px) {
  .archive-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }
}

@media (max-width: 900px) {
  .archive-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 680px) {
  .container {
    padding: 20px 20px 20px;
  }
  
  .archive-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .top-nav {
    padding: 0;
    margin-bottom: 15px;
    align-items: center;
    gap: 15px;
  }

  .theme-selector {
    gap: 8px;
  }

  .back-link a {
    padding: 8px 16px;
    font-size: 0;
    letter-spacing: 0 !important;
  }

  .back-link a::before {
    content: "← Back";
    font-size: 0.8rem;
  }

  .theme-label {
    display: none;
  }

  .theme-dropdown {
    padding: 6px 12px;
    font-size: 0.8em;
    padding-right: 16px;
  }
  
  h1 {
    font-size: 2.5rem;
  }
  
  .item-content {
    padding: 16px;
  }
}