/* Brettspiel Plugin - Frontend Styles */
/* Fonts from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap');

:root {
    --bsp-primary: #fd5e29;
    --bsp-primary-dark: #e54d1a;
    --bsp-bg: #f8f9fa;
    --bsp-card-bg: #ffffff;
    --bsp-text: #2c3e50;
    --bsp-text-light: #7f8c8d;
    --bsp-border: #e1e8ed;
    --bsp-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --bsp-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.bsp-frontend-wrapper {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Search Bar */
.bsp-search-container {
    margin-bottom: 20px;
}

.bsp-search-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    font-family: 'Montserrat', sans-serif;
    border: 2px solid var(--bsp-border);
    border-radius: 12px;
    background: var(--bsp-card-bg);
    transition: all 0.3s ease;
}

.bsp-search-input:focus {
    outline: none;
    border-color: var(--bsp-primary);
    box-shadow: 0 0 0 3px rgba(253, 94, 41, 0.1);
}

.bsp-search-input::placeholder {
    color: var(--bsp-text-light);
}

/* Action Buttons */
.bsp-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.bsp-btn {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bsp-btn-filter {
    background: var(--bsp-card-bg);
    color: var(--bsp-text);
    border: 2px solid var(--bsp-border);
}

.bsp-btn-filter:hover,
.bsp-btn-filter.active {
    background: var(--bsp-primary);
    color: white;
    border-color: var(--bsp-primary);
    transform: translateY(-2px);
    box-shadow: var(--bsp-shadow);
}

.bsp-btn-guru {
    background: var(--bsp-bg);
    color: var(--bsp-text-light);
    border: 2px solid var(--bsp-border);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Filter Panel */
.bsp-filter-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin-bottom 0.4s ease;
    margin-bottom: 0;
}

.bsp-filter-panel.active {
    max-height: 2000px;
    margin-bottom: 30px;
}

.bsp-filter-content {
    background: var(--bsp-card-bg);
    border: 2px solid var(--bsp-border);
    border-radius: 12px;
    padding: 24px;
}

.bsp-filter-group {
    margin-bottom: 20px;
}

.bsp-filter-group:last-of-type {
    margin-bottom: 24px;
}

.bsp-filter-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bsp-text-light);
    margin-bottom: 10px;
}

/* Filter Select (Dropdown) */
.bsp-filter-select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    border: 2px solid var(--bsp-border);
    border-radius: 8px;
    background: var(--bsp-card-bg);
    min-height: 42px;
}

.bsp-filter-select:focus {
    outline: none;
    border-color: var(--bsp-primary);
}

.bsp-filter-select option {
    padding: 8px;
}

.bsp-filter-select option:checked {
    background: var(--bsp-primary);
    color: white;
}

/* Filter Range (Player count) */
.bsp-filter-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bsp-filter-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    border: 2px solid var(--bsp-border);
    border-radius: 8px;
    background: var(--bsp-card-bg);
}

.bsp-filter-input:focus {
    outline: none;
    border-color: var(--bsp-primary);
}

.bsp-filter-range span {
    color: var(--bsp-text-light);
    font-size: 14px;
}

/* Filter Checkboxes */
.bsp-filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.bsp-filter-checkboxes label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--bsp-text);
    cursor: pointer;
    user-select: none;
}

.bsp-filter-checkboxes input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--bsp-primary);
}

/* Filter Actions */
.bsp-filter-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid var(--bsp-border);
}

.bsp-btn-reset {
    background: var(--bsp-bg);
    color: var(--bsp-text);
    border: 2px solid var(--bsp-border);
    padding: 10px 20px;
    font-size: 14px;
}

.bsp-btn-reset:hover {
    background: var(--bsp-text-light);
    color: white;
    border-color: var(--bsp-text-light);
}

/* No Games Message */
.bsp-no-games {
    text-align: center;
    font-size: 18px;
    color: var(--bsp-text-light);
    padding: 60px 20px;
}

/* No Results Message */
.bsp-no-results {
    text-align: center;
    padding: 60px 20px;
}

.bsp-no-results p {
    font-size: 18px;
    color: var(--bsp-text-light);
    margin: 0;
}

/* Games Grid */
.bsp-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .bsp-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }
}

/* Game Card */
.bsp-game-card {
    background: var(--bsp-card-bg);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--bsp-shadow);
}

.bsp-game-card.hidden {
    display: none;
}

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

.bsp-game-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 quadratisch */
    overflow: hidden;
    background: var(--bsp-bg);
}

.bsp-game-image img {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: auto;
    min-height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 0.3s ease;
}

.bsp-game-card:hover .bsp-game-image img {
    transform: translateX(-50%) scale(1.05);
}

.bsp-game-info {
    padding: 12px;
    text-align: center;
}

.bsp-game-title {
    font-family: 'Oswald', sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--bsp-text);
    margin: 0 0 6px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bsp-game-year {
    font-size: 14px;
    color: var(--bsp-text-light);
    margin: 0;
}

/* Modal */
.bsp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

.bsp-modal.active {
    display: block;
}

.bsp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.bsp-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bsp-card-bg);
    border-radius: 16px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.bsp-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.bsp-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: rotate(90deg);
}

/* Modal Body */
#bsp-modal-body {
    padding: 24px;
}

.bsp-modal-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--bsp-text-light);
}

.bsp-modal-error {
    text-align: center;
    padding: 40px 20px;
    color: #e74c3c;
}

/* Modal Content Layout */
.bsp-modal-header {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    align-items: flex-start;
}

@media (max-width: 600px) {
    .bsp-modal-header {
        flex-direction: column;
    }
}

.bsp-modal-image {
    flex-shrink: 0;
    width: 200px;
    height: 280px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--bsp-shadow);
}

@media (max-width: 600px) {
    .bsp-modal-image {
        width: 100%;
        height: auto;
        max-width: 300px;
        margin: 0 auto;
    }
}

.bsp-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bsp-modal-title-section {
    flex: 1;
}

.bsp-modal-title {
    font-family: 'Oswald', sans-serif;
    font-size: 36px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--bsp-text);
    margin: 0 0 8px 0;
}

.bsp-modal-meta {
    font-size: 15px;
    font-weight: 500;
    color: var(--bsp-text-light);
    margin-bottom: 16px;
}

.bsp-modal-meta span {
    margin-right: 12px;
}

.bsp-modal-section-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bsp-text-light);
    margin-bottom: 8px;
    margin-top: 16px;
    display: block;
    width: 100%;
}

.bsp-modal-section-label:first-child {
    margin-top: 0;
}

.bsp-modal-tags {
    display: block;
    margin-top: 12px;
}

.bsp-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.bsp-tag {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bsp-bg);
    color: var(--bsp-text);
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    text-transform: capitalize;
}

.bsp-tag.primary {
    background: var(--bsp-primary);
    color: white;
}

/* Modal Details Grid */
.bsp-modal-details {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bsp-bg);
    border-radius: 8px;
}

@media (max-width: 768px) {
    .bsp-modal-details {
        grid-template-columns: repeat(2, 1fr);
    }
}

.bsp-detail-item {
    text-align: center;
}

.bsp-detail-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bsp-text-light);
    margin-bottom: 4px;
}

.bsp-detail-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--bsp-text);
}

.bsp-complexity-value {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bsp-complexity-value .number {
    font-size: 24px;
    color: var(--bsp-primary);
}

.bsp-complexity-value .label {
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    background: var(--bsp-primary);
    color: white;
    border-radius: 4px;
}

/* Description */
.bsp-modal-description {
    margin-bottom: 24px;
}

.bsp-modal-description h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--bsp-text);
    margin: 0 0 12px 0;
}

.bsp-modal-description p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--bsp-text);
    margin: 0;
}

/* Scrollbar Styling */
.bsp-modal-content::-webkit-scrollbar {
    width: 8px;
}

.bsp-modal-content::-webkit-scrollbar-track {
    background: var(--bsp-bg);
}

.bsp-modal-content::-webkit-scrollbar-thumb {
    background: var(--bsp-primary);
    border-radius: 4px;
}

.bsp-modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--bsp-primary-dark);
}

/* Responsive */
@media (max-width: 600px) {
    .bsp-filter-checkboxes {
        flex-direction: column;
        gap: 8px;
    }
}

/* Search & Filter Styles */

/* Search Container */
.bsp-search-container {
    margin-bottom: 20px;
}

.bsp-search-input {
    width: 100%;
    padding: 14px 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    border: 2px solid var(--bsp-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.bsp-search-input:focus {
    outline: none;
    border-color: var(--bsp-primary);
    box-shadow: 0 0 0 3px rgba(253, 94, 41, 0.1);
}

/* Action Buttons */
.bsp-action-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.bsp-btn {
    flex: 1;
    padding: 14px 24px;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--bsp-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bsp-btn-filter {
    background: var(--bsp-primary);
    color: white;
}

.bsp-btn-filter:hover {
    background: var(--bsp-primary-dark);
}

.bsp-btn-filter.active {
    background: var(--bsp-primary-dark);
}

.bsp-btn-guru {
    background: white;
    color: var(--bsp-primary);
}

.bsp-btn-guru:hover {
    background: var(--bsp-bg);
}

/* Filter Panel */
.bsp-filter-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    margin-bottom: 30px;
}

.bsp-filter-panel.active {
    max-height: 2000px;
    transition: max-height 0.6s ease-in;
}

.bsp-filter-content {
    padding: 24px;
    background: var(--bsp-bg);
    border: 2px solid var(--bsp-border);
    border-radius: 8px;
    margin-bottom: 20px;
}

.bsp-filter-group {
    margin-bottom: 20px;
}

.bsp-filter-group:last-of-type {
    margin-bottom: 0;
}

.bsp-filter-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--bsp-text-light);
    margin-bottom: 10px;
}

/* Filter Select (Dropdown) */
.bsp-filter-select {
    width: 100%;
    padding: 10px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    border: 1px solid var(--bsp-border);
    border-radius: 6px;
    background: white;
    min-height: 120px;
}

.bsp-filter-select option {
    padding: 8px;
}

/* Single Select Dropdown */
.bsp-filter-select-single {
    width: 100%;
    padding: 10px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    border: 1px solid var(--bsp-border);
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.bsp-filter-select-single:focus {
    outline: none;
    border-color: var(--bsp-primary);
}

/* 2x2 Grid Layout */
.bsp-filter-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.bsp-filter-grid-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.bsp-filter-grid-item {
    margin-bottom: 0;
}

/* Compact Checkboxes */
.bsp-filter-checkboxes-compact {
    gap: 6px;
}

.bsp-filter-checkboxes-compact label {
    padding: 6px 10px;
    font-size: 13px;
}

@media (max-width: 768px) {
    .bsp-filter-grid-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Filter Range Inputs */
.bsp-filter-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bsp-filter-input {
    flex: 1;
    padding: 10px 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    border: 1px solid var(--bsp-border);
    border-radius: 6px;
}

.bsp-filter-range span {
    color: var(--bsp-text-light);
    font-size: 14px;
}

/* Filter Checkboxes */
.bsp-filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.bsp-filter-checkboxes label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--bsp-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.bsp-filter-checkboxes label:hover {
    border-color: var(--bsp-primary);
    background: rgba(253, 94, 41, 0.05);
}

.bsp-filter-checkboxes input[type="checkbox"] {
    cursor: pointer;
}

.bsp-filter-checkboxes input[type="checkbox"]:checked + label,
.bsp-filter-checkboxes label:has(input[type="checkbox"]:checked) {
    background: var(--bsp-primary);
    color: white;
    border-color: var(--bsp-primary);
}

/* Compact Checkboxes for Grid */
.bsp-filter-compact {
    gap: 8px;
}

.bsp-filter-compact label {
    padding: 6px 10px;
    font-size: 13px;
}

/* Filter Actions */
.bsp-filter-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--bsp-border);
}

.bsp-btn-reset {
    padding: 10px 20px;
    background: white;
    color: var(--bsp-text);
    border: 1px solid var(--bsp-border);
    font-size: 14px;
    font-weight: 500;
}

.bsp-btn-reset:hover {
    background: var(--bsp-bg);
    border-color: var(--bsp-text-light);
}

/* No Results Message */
.bsp-no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--bsp-text-light);
    font-size: 18px;
}

/* Hidden Cards */
.bsp-game-card.hidden {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .bsp-action-buttons {
        flex-direction: column;
    }
    
    .bsp-filter-checkboxes {
        flex-direction: column;
    }
    
    .bsp-filter-checkboxes label {
        width: 100%;
    }
}

/* Regal & Spielregeln Styles */

/* Lila Regal Button */
.bsp-tag.shelf {
    background: #572dbd;
    color: white;
}

/* Spielregeln Links */
.bsp-rules-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.bsp-rules-link {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bsp-bg);
    color: var(--bsp-text);
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    text-transform: capitalize;
    transition: all 0.2s ease;
}

.bsp-rules-link:hover {
    background: var(--bsp-primary);
    color: white;
    text-decoration: none;
}
