/* ============================================
   BASE LAYOUT STYLES
   Styles for baseof.html layout components
   ============================================ */

/* Search Container Styles */
#search {
    position: relative;
    z-index: 10000;
}

/* Style the search results as a floating overlay */
#search .pagefind-ui__results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 500px;
    overflow-y: auto;
    z-index: 100000;
    margin-top: 8px;
}

/* Hide results when empty */
#search .pagefind-ui__results:empty {
    display: none;
}

/* Ensure the search input doesn't cause layout shifts */
#search .pagefind-ui__search-input {
    width: 100%;
}

/* Dark theme search results */
[data-theme="dark"] #search .pagefind-ui__results {
    background: #2d2d2d;
    border-color: #555;
}

/* ============================================
   THEME DROPDOWN STYLES
   ============================================ */

.theme-selector {
    position: relative;
    margin-left: 1rem;
    flex-shrink: 0;
    z-index: 10000;
    isolation: isolate;
}

.theme-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color, #333);
    border-radius: 4px;
    transition: background 0.2s ease;
    position: relative;
    z-index: 10002;
}

.theme-toggle-btn svg {
    display: block;
}

.theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .theme-toggle-btn {
    color: #e0e0e0;
}

[data-theme="dark"] .theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 99999;
}

.theme-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
    color: #333;
    font-size: 0.95rem;
}

.theme-option:first-child {
    border-radius: 8px 8px 0 0;
}

.theme-option:last-child {
    border-radius: 0 0 8px 8px;
}

.theme-option:hover {
    background: #f5f5f5;
}

.theme-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.theme-name {
    flex: 1;
    font-weight: 500;
}

.theme-check {
    color: #0066cc;
    opacity: 0;
    font-weight: bold;
}

.theme-option.active .theme-check {
    opacity: 1;
}

/* Dark theme dropdown */
[data-theme="dark"] .theme-dropdown {
    background: #2d2d2d;
    border-color: #555;
}

[data-theme="dark"] .theme-option {
    color: #e0e0e0;
}

[data-theme="dark"] .theme-option:hover {
    background: #3d3d3d;
}

[data-theme="dark"] .theme-check {
    color: #4da6ff;
}

/* 90s theme dropdown */
[data-theme="90s"] .theme-dropdown {
    background: #ffff00;
    border: 3px solid #000;
    box-shadow: 5px 5px 0 #ff00ff;
}

[data-theme="90s"] .theme-option {
    color: #000;
    font-family: 'Comic Sans MS', cursive;
}

[data-theme="90s"] .theme-option:hover {
    background: #00ffff;
}

[data-theme="90s"] .theme-check {
    color: #ff00ff;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .theme-selector {
        margin-left: 0.5rem;
    }

    .theme-dropdown {
        right: -0.5rem;
    }
}

/* Theme overlay for closing dropdown */
.theme-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: none;
}

.theme-overlay.active {
    display: block;
}


/* Theme Toggle Styles */
.theme-toggle {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: 1rem;
}

.theme-toggle button {
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.theme-toggle button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.theme-toggle button.active {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
}

.theme-toggle button[data-theme="90s"] {
    background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00);
    border: 2px solid #000;
    animation: rainbow-border 3s ease infinite;
}

.theme-toggle button[data-theme="90s"].active {
    animation: rainbow-border 1s ease infinite, pulse 1s ease infinite;
}

@keyframes rainbow-border {
    0% { border-color: #ff00ff; }
    33% { border-color: #00ffff; }
    66% { border-color: #ffff00; }
    100% { border-color: #ff00ff; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Dark theme in search results */
[data-theme="dark"] #search .pagefind-ui__results {
    background: #2d2d2d;
    border-color: #555;
}

/* Mobile responsive theme toggle */
@media (max-width: 768px) {
    .theme-toggle {
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
        margin-left: 0;
    }

    .theme-toggle button {
        flex: 1;
        justify-content: center;
    }
}

.releases {
  margin-top: 0.5rem;  /* Reduce this */
}

.releases h2 {
  margin-top: 0.5rem;  /* Reduce this */
  padding-top: 0.5rem; /* Reduce this */
  border-top: 1px solid #fff; /* This might be your line */
}

/* Or if the line is on the header: */
.game-header {
  margin-bottom: 0.5rem; /* Reduce this */
  padding-bottom: 0.5rem; /* Reduce this */
  border-bottom: 1px solid #ccc;
}

/* Or if the line is on the header: */
.game-footer {
  margin-bottom: 0.5rem; /* Reduce this */
  padding-bottom: 0.5rem; /* Reduce this */
  border-top: 1px solid #ccc;
}