/* Cache Settings Page Styles */

.settings-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 0.7;
}

.settings-container h1 {
  font-size: 2.5em;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 16px;
}

/* Storage Info Card */
.storage-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
}

.storage-info-card h2 {
  font-size: 1.3em;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.storage-bar-container {
  margin-bottom: 12px;
}

.storage-bar {
  width: 100%;
  height: 24px;
  background: var(--background);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 8px;
}

.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  transition: width 0.3s ease;
  width: 0%;
}

.storage-details {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.storage-breakdown {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

.breakdown-label {
  color: var(--text-secondary);
}

.breakdown-value {
  font-weight: 600;
  color: var(--text-primary);
}

/* Modules Section */
.modules-section {
  margin-bottom: 40px;
}

.modules-section h2 {
  font-size: 1.5em;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.section-description {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 14px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.bulk-actions {
  display: flex;
  gap: 8px;
}

/* Module Card */
.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  transition: box-shadow 0.2s;
}

.module-card:hover {
  box-shadow: 0 2px 8px var(--shadow);
}

.module-card.required {
  background: var(--background);
  border-color: var(--primary);
  opacity: 0.8;
}

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

.module-info h3 {
  font-size: 1.1em;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.module-info p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.module-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.module-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.module-size {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  min-width: 60px;
  text-align: right;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.required {
  background: var(--primary);
  color: white;
}

.module-status-text {
  font-size: 14px;
  font-weight: 500;
  min-width: 80px;
  text-align: right;
}

.module-status-text.cached {
  color: #27ae60;
}

.module-status-text.not-cached {
  color: var(--text-secondary);
}

.module-status-text.caching {
  color: var(--primary);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.game-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s;
  cursor: pointer;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow);
}

.game-card.cached {
  border-color: var(--primary);
}

.game-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.game-card h3 {
  font-size: 1.1em;
  color: var(--text-primary);
  margin: 0;
}

.game-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
}

.game-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.game-size {
  font-size: 12px;
  color: var(--text-secondary);
}

.cache-status {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
}

.cache-status.cached {
  color: #27ae60;
}

.cache-status.not-cached {
  color: var(--text-secondary);
}

.cache-status svg {
  width: 16px;
  height: 16px;
}

/* Buttons */
.btn-secondary,
.btn-danger {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--background);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-danger {
  background: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background: #c0392b;
}

/* Cache Actions */
.cache-actions {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid var(--border);
  text-align: center;
}

.action-description {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* Loading State */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Responsive */
@media (max-width: 768px) {
  .settings-container {
    padding: 16px;
  }

  .settings-container h1 {
    font-size: 2em;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .module-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .module-controls {
    width: 100%;
    justify-content: space-between;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .bulk-actions {
    width: 100%;
  }

  .bulk-actions button {
    flex: 1;
  }
}
