/**
 * TGP Game Hub Archive - Modern Dark Theme
 * Version 2.0.0
 */

:root {
    --tgp-bg: #19192a;
    --tgp-surface: rgba(255, 255, 255, 0.03);
    --tgp-surface-hover: rgba(255, 255, 255, 0.06);
    --tgp-border: rgba(255, 255, 255, 0.08);
    --tgp-border-light: rgba(255, 255, 255, 0.12);
    --tgp-accent: #ff8a00;
    --tgp-accent-hover: #ff9f2e;
    --tgp-text: #f0f0f5;
    --tgp-text-muted: rgba(255, 255, 255, 0.65);
    --tgp-radius: 10px;
    --tgp-radius-sm: 6px;
    --tgp-radius-lg: 14px;
    --tgp-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    --tgp-transition: 0.15s ease;
}

/* ========================================
   Layout
   ======================================== */

.tgp-archive {
    background: var(--tgp-bg);
    min-height: 100vh;
    padding-bottom: 60px;
}

.tgp-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 1280px) {
    .tgp-container {
        padding: 0 48px;
    }
}

/* ========================================
   Hero Section
   ======================================== */

.tgp-archive-hero {
    position: relative;
    min-height: 220px;
    background: var(--hero-bg) center/cover no-repeat;
    display: flex;
    align-items: flex-end;
    padding: 40px 16px 30px;
}

.tgp-archive-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(25, 25, 42, 0.5) 0%,
        rgba(25, 25, 42, 0.7) 50%,
        rgba(25, 25, 42, 0.95) 100%
    );
}

.tgp-archive-hero-content {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 1280px) {
    .tgp-archive-hero {
        padding: 50px 48px 35px;
    }
}

/* Simple Header (no hero image) */
.tgp-archive-header {
    padding: 40px 0 24px;
}

.tgp-archive-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--tgp-text);
    margin: 0 0 6px;
    line-height: 1.2;
}

.tgp-archive-subtitle {
    font-size: 0.95rem;
    color: var(--tgp-text-muted);
    margin: 0;
}

/* Breadcrumb */
.tgp-breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.tgp-breadcrumb a {
    color: var(--tgp-text-muted);
    text-decoration: none;
    transition: color var(--tgp-transition);
}

.tgp-breadcrumb a:hover {
    color: var(--tgp-accent);
}

.tgp-bc-sep {
    color: var(--tgp-text-muted);
    margin: 0 8px;
    opacity: 0.5;
}

.tgp-bc-current {
    color: var(--tgp-text);
}

/* ========================================
   Toolbar
   ======================================== */

.tgp-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 8px;
}

.tgp-search-form {
    flex: 1;
    min-width: 200px;
    max-width: 320px;
}

.tgp-search-wrap {
    position: relative;
}

.tgp-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tgp-text-muted);
    pointer-events: none;
}

.tgp-search-input {
    width: 100%;
    padding: 10px 14px 10px 44px;
    background: var(--tgp-surface);
    border: 1px solid var(--tgp-border);
    border-radius: var(--tgp-radius);
    color: var(--tgp-text);
    font-size: 0.9rem;
    transition: all var(--tgp-transition);
}

.tgp-search-input::placeholder {
    color: var(--tgp-text-muted);
}

.tgp-search-input:focus {
    outline: none;
    border-color: var(--tgp-accent);
    background: var(--tgp-surface-hover);
}

.tgp-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tgp-platform-select {
    padding: 10px 32px 10px 14px;
    background: var(--tgp-surface);
    border: 1px solid var(--tgp-border);
    border-radius: var(--tgp-radius);
    color: var(--tgp-text);
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all var(--tgp-transition);
}

.tgp-platform-select:hover {
    border-color: var(--tgp-border-light);
}

.tgp-platform-select:focus {
    outline: none;
    border-color: var(--tgp-accent);
}

.tgp-calendar-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--tgp-accent);
    border-radius: var(--tgp-radius);
    color: #000;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--tgp-transition);
}

.tgp-calendar-link:hover {
    background: var(--tgp-accent-hover);
}

@media (max-width: 640px) {
    .tgp-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tgp-search-form {
        max-width: none;
    }
    
    .tgp-filters {
        justify-content: space-between;
    }
}

/* ========================================
   A-Z Filter
   ======================================== */

.tgp-az-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px 0;
    margin-bottom: 20px;
    border-top: 1px solid var(--tgp-border);
    border-bottom: 1px solid var(--tgp-border);
}

.tgp-az-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--tgp-radius-sm);
    color: var(--tgp-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--tgp-transition);
}

.tgp-az-btn:hover {
    color: var(--tgp-text);
    background: var(--tgp-surface);
}

.tgp-az-btn.active {
    background: var(--tgp-accent);
    color: #000;
    font-weight: 600;
}

/* ========================================
   Games Grid
   ======================================== */

.tgp-games-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (min-width: 1400px) {
    .tgp-games-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1024px) {
    .tgp-games-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 640px) {
    .tgp-games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Game Tile */
.tgp-game-tile {
    border-radius: var(--tgp-radius);
    overflow: hidden;
    background: var(--tgp-surface);
    border: 1px solid var(--tgp-border);
    transition: all var(--tgp-transition);
}

.tgp-game-tile:hover {
    border-color: var(--tgp-border-light);
    transform: translateY(-2px);
    box-shadow: var(--tgp-shadow);
}

.tgp-tile-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.tgp-tile-image {
    aspect-ratio: 2/3;
    overflow: hidden;
    background: #111;
}

.tgp-tile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tgp-game-tile:hover .tgp-tile-image img {
    transform: scale(1.03);
}

.tgp-tile-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2a2a3d, #1a1a2a);
}

.tgp-tile-info {
    padding: 12px;
}

.tgp-tile-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--tgp-text);
    margin: 0 0 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tgp-tile-date {
    display: block;
    font-size: 0.75rem;
    color: var(--tgp-accent);
    font-weight: 500;
}

.tgp-tile-platforms {
    display: block;
    font-size: 0.7rem;
    color: var(--tgp-text-muted);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   Calendar Specific
   ======================================== */

.tgp-calendar-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.tgp-calendar-picker {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tgp-picker-select {
    padding: 10px 32px 10px 14px;
    background: var(--tgp-surface);
    border: 1px solid var(--tgp-border);
    border-radius: var(--tgp-radius);
    color: var(--tgp-text);
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23888' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: all var(--tgp-transition);
}

.tgp-picker-select:focus {
    outline: none;
    border-color: var(--tgp-accent);
}

.tgp-apply-btn {
    padding: 10px 18px;
    background: var(--tgp-accent);
    border: none;
    border-radius: var(--tgp-radius);
    color: #000;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--tgp-transition);
}

.tgp-apply-btn:hover {
    background: var(--tgp-accent-hover);
}

.tgp-back-to-hub {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--tgp-surface);
    border: 1px solid var(--tgp-border);
    border-radius: var(--tgp-radius);
    color: var(--tgp-text);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--tgp-transition);
}

.tgp-back-to-hub:hover {
    background: var(--tgp-surface-hover);
    border-color: var(--tgp-border-light);
}

.tgp-calendar-label {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 0 20px;
    border-bottom: 1px solid var(--tgp-border);
    margin-bottom: 20px;
}

.tgp-calendar-label h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--tgp-text);
    margin: 0;
}

.tgp-clear-filter {
    font-size: 0.8rem;
    color: var(--tgp-accent);
    text-decoration: none;
}

.tgp-clear-filter:hover {
    text-decoration: underline;
}

/* Calendar Grid */
.tgp-calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

@media (max-width: 1200px) {
    .tgp-calendar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .tgp-calendar-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 540px) {
    .tgp-calendar-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Calendar Card */
.tgp-calendar-card {
    border-radius: var(--tgp-radius);
    overflow: hidden;
    background: var(--tgp-surface);
    border: 1px solid var(--tgp-border);
    transition: all var(--tgp-transition);
}

.tgp-calendar-card:hover {
    border-color: var(--tgp-border-light);
    transform: translateY(-2px);
    box-shadow: var(--tgp-shadow);
}

.tgp-cal-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.tgp-cal-image {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: #111;
}

.tgp-cal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tgp-calendar-card:hover .tgp-cal-image img {
    transform: scale(1.03);
}

.tgp-cal-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2a2a3d, #1a1a2a);
}

.tgp-cal-date-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 4px 8px;
    background: var(--tgp-accent);
    border-radius: 4px;
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
}

.tgp-cal-info {
    padding: 10px;
}

.tgp-cal-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--tgp-text);
    margin: 0 0 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tgp-cal-platforms {
    display: block;
    font-size: 0.7rem;
    color: var(--tgp-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========================================
   Platform Archive
   ======================================== */

.tgp-platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.tgp-platform-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--tgp-surface);
    border: 1px solid var(--tgp-border);
    border-radius: var(--tgp-radius);
    color: var(--tgp-text);
    text-decoration: none;
    transition: all var(--tgp-transition);
}

.tgp-platform-card:hover {
    background: var(--tgp-surface-hover);
    border-color: var(--tgp-accent);
    transform: translateX(4px);
}

.tgp-platform-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.tgp-platform-count {
    font-size: 0.8rem;
    color: var(--tgp-text-muted);
    margin-left: auto;
    margin-right: 12px;
}

.tgp-platform-arrow {
    color: var(--tgp-text-muted);
    transition: all var(--tgp-transition);
}

.tgp-platform-card:hover .tgp-platform-arrow {
    color: var(--tgp-accent);
    transform: translateX(3px);
}

/* ========================================
   Pagination
   ======================================== */

.tgp-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--tgp-border);
}

.tgp-pagination a,
.tgp-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: var(--tgp-surface);
    border: 1px solid var(--tgp-border);
    border-radius: var(--tgp-radius-sm);
    color: var(--tgp-text);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all var(--tgp-transition);
}

.tgp-pagination a:hover {
    background: var(--tgp-surface-hover);
    border-color: var(--tgp-accent);
}

.tgp-pagination .current {
    background: var(--tgp-accent);
    border-color: var(--tgp-accent);
    color: #000;
    font-weight: 600;
}

.tgp-pagination .dots {
    background: transparent;
    border-color: transparent;
    color: var(--tgp-text-muted);
}

.tgp-pagination .prev,
.tgp-pagination .next {
    padding: 0 8px;
}

/* ========================================
   No Results
   ======================================== */

.tgp-no-results {
    text-align: center;
    padding: 60px 20px;
}

.tgp-no-results p {
    color: var(--tgp-text-muted);
    font-size: 1rem;
    margin: 0 0 20px;
}

.tgp-reset-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: var(--tgp-accent);
    border-radius: var(--tgp-radius);
    color: #000;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--tgp-transition);
}

.tgp-reset-btn:hover {
    background: var(--tgp-accent-hover);
}

/* ========================================
   Mobile Optimizations
   ======================================== */

@media (max-width: 480px) {
    .tgp-archive-title {
        font-size: 1.4rem;
    }
    
    .tgp-archive-subtitle {
        font-size: 0.85rem;
    }
    
    .tgp-calendar-picker {
        width: 100%;
    }
    
    .tgp-picker-select {
        flex: 1;
    }
    
    .tgp-calendar-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tgp-back-to-hub {
        justify-content: center;
    }
}
