/**
 * Board Game Playthroughs Page Styles
 *
 * Builds on ranking-pages-shared.css for consistency
 * Custom styles specific to playthrough listing page
 */

.board-games-playthroughs-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 60px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    position: relative;
    /* Wavy borders on left and right sides only, straight top and bottom */
    clip-path: polygon(
        0% 0%, 100% 0%,
        98% 5%, 99% 10%, 97% 15%, 100% 20%, 98% 25%, 99% 30%, 97% 35%, 100% 40%, 98% 45%, 99% 50%, 97% 55%, 100% 60%, 98% 65%, 99% 70%, 97% 75%, 100% 80%, 98% 85%, 99% 90%, 97% 95%,
        100% 100%, 0% 100%,
        2% 95%, 1% 90%, 3% 85%, 0% 80%, 2% 75%, 1% 70%, 3% 65%, 0% 60%, 2% 55%, 1% 50%, 3% 45%, 0% 40%, 2% 35%, 1% 30%, 3% 25%, 0% 20%, 2% 15%, 1% 10%, 3% 5%
    );
}

/* Top torn edge - green accent */
.board-games-playthroughs-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: #4da44b;
    clip-path: polygon(0% 0%, 10% 80%, 20% 60%, 30% 90%, 40% 50%, 50% 85%, 60% 40%, 70% 75%, 80% 55%, 90% 80%, 100% 0%, 100% 0%, 0% 0%);
    z-index: 1;
}

/* Bottom torn edge - green accent */
.board-games-playthroughs-page::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20px;
    background: #4da44b;
    clip-path: polygon(0% 100%, 10% 20%, 20% 40%, 30% 10%, 40% 50%, 50% 15%, 60% 60%, 70% 25%, 80% 45%, 90% 20%, 100% 100%, 100% 100%, 0% 100%);
    z-index: 1;
}

/* Ensure all content appears above the torn edges */
.board-games-playthroughs-page > * {
    position: relative;
    z-index: 2;
}

/* Highlight numbers in page description */
.page-description .highlight-number {
    color: #4da44b;
    font-weight: 700;
}

/* Stats Bar */
.playthroughs-stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    border-radius: 12px;
    border: 1px solid #404040;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #4da44b;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.stat-label {
    font-size: 0.875rem;
    color: #b0b0b0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* A-Z Index */
.az-index {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    margin-bottom: 30px;
    padding: 12px 12px;
    background: #2d2d2d;
    border-radius: 12px;
    border: 1px solid #404040;
}

.az-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 3px;
    width: 18px;
    height: 18px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 3px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.az-letter.active {
    background: linear-gradient(135deg, #4da44b, #059669);
    color: white;
    cursor: pointer;
    text-decoration: none;
}

.az-letter.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(77, 164, 75, 0.4);
}

.az-letter.inactive {
    color: #555;
    cursor: not-allowed;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: #2d2d2d;
    border-radius: 12px;
    border: 1px solid #404040;
}

.game-search-input {
    flex: 1;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #404040;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.game-search-input:focus {
    outline: none;
    border-color: #4da44b;
    box-shadow: 0 0 0 3px rgba(77, 164, 75, 0.1);
}

.game-search-input::placeholder {
    color: #666;
}

.search-results-count {
    color: #4da44b;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Games Container */
.games-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Game Section */
.game-section {
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    border-radius: 16px;
    border: 2px solid #404040;
    padding: 30px;
    transition: all 0.3s ease;
}

.game-section:hover {
    border-color: #4da44b;
    box-shadow: 0 8px 24px rgba(77, 164, 75, 0.1);
}

/* Game Header */
.game-header {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #404040;
}

.game-box-art {
    flex-shrink: 0;
}

.game-box-art img {
    width: 120px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.game-box-art a:hover img {
    transform: scale(1.05);
}

.game-info {
    flex: 1;
}

.game-name {
    margin: 0 0 10px 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.game-name a {
    color: #4da44b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.game-name a:hover {
    color: #059669;
    text-decoration: underline;
}

.playthrough-count {
    color: #b0b0b0;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Playthroughs Grid */
.playthroughs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Playthrough Card */
.playthrough-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #333;
    transition: all 0.3s ease;
}

.playthrough-card:hover {
    border-color: #4da44b;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(77, 164, 75, 0.2);
}

.playthrough-thumbnail {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
}

.playthrough-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.playthrough-card:hover .playthrough-thumbnail img {
    transform: scale(1.05);
}

.playthrough-info {
    padding: 15px;
}

.playthrough-title {
    display: block;
    color: #e0e0e0;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    margin-bottom: 8px;
    transition: color 0.2s ease;
}

.playthrough-title:hover {
    color: #4da44b;
}

.playthrough-episode {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(77, 164, 75, 0.2);
    color: #4da44b;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Type badge — inline above title in card info area */
.playthrough-type-badge {
    display: inline-block;
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    margin-bottom: 6px;
}

/* Empty State */
.no-playthroughs {
    text-align: center;
    padding: 60px 20px;
    color: #b0b0b0;
}

.no-playthroughs p {
    font-size: 1.125rem;
}

/* --- HEADER: smaller on both desktop and mobile --- */
.board-games-playthroughs-page .page-header,
.video-games-playthroughs-page .page-header {
    padding: 20px 15px;
    margin-bottom: 25px;
}

.board-games-playthroughs-page .page-title,
.video-games-playthroughs-page .page-title {
    font-size: 2rem;
}

.board-games-playthroughs-page .page-description,
.video-games-playthroughs-page .page-description {
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .board-games-playthroughs-page,
    .video-games-playthroughs-page {
        padding: 20px 10px;
    }

    /* Header: compact on mobile */
    .board-games-playthroughs-page .page-header,
    .video-games-playthroughs-page .page-header {
        padding: 15px 10px;
        margin-bottom: 15px;
    }

    .board-games-playthroughs-page .page-title,
    .video-games-playthroughs-page .page-title {
        font-size: 1.5rem;
    }

    .board-games-playthroughs-page .page-description,
    .video-games-playthroughs-page .page-description {
        font-size: 0.85rem;
    }

    .playthroughs-stats {
        flex-direction: column;
        gap: 15px;
    }

    /* A-Z index: wrap to fit on mobile */
    .az-index {
        flex-wrap: wrap;
        gap: 4px;
        padding: 10px;
        justify-content: center;
    }

    .az-letter {
        width: 22px;
        height: 22px;
        font-size: 0.7rem;
        margin: 0 1px;
        flex-shrink: 0;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .game-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        margin-bottom: 15px;
        padding-bottom: 15px;
    }

    /* Box art: smaller on mobile */
    .game-box-art img {
        width: 70px;
    }

    .game-name {
        font-size: 1.3rem;
    }

    .playthroughs-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .game-section {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .stat-number {
        font-size: 1.5rem;
    }

    .board-games-playthroughs-page .page-title,
    .video-games-playthroughs-page .page-title {
        font-size: 1.3rem;
    }

    .az-letter {
        width: 20px;
        height: 20px;
        font-size: 0.65rem;
    }

    .game-box-art img {
        width: 60px;
    }

    .game-name {
        font-size: 1.1rem;
    }

    .game-section {
        padding: 12px;
    }
}
