﻿/* Reset und Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header und Banner */
.site-header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 0;
    padding: 0;
}

.banner-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin: 0;
    padding: 0;
}

/* Optionales Muster für den Platzhalter */
.banner-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, rgba(255,255,255,.05) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,.05) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,.05) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.05) 75%);
    background-size: 60px 60px;
    background-position: 0 0, 0 30px, 30px -30px, -30px 0;
    opacity: 0.3;
}

.banner-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px 20px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.banner-logo {
    width: 160px !important;
    height: 160px !important;
    max-width: 160px !important;
    max-height: 160px !important;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
    flex-shrink: 0;
}

.site-title {
    color: #fff;
    font-size: 3em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin: 0;
    text-align: left;
    white-space: nowrap;
}

/* Auth Buttons */
.auth-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.user-greeting {
    color: #fff;
    margin-right: 10px;
    font-weight: 500;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover,
.modal-close:focus {
    background: rgba(102, 126, 234, 0.9);
    text-decoration: none;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    font-size: 28px;
    color: #999;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal h2 {
    margin: 0 0 20px 0;
    color: #667eea;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

/* Notice Styles */
.notice {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 4px;
    border-left: 4px solid;
}

.notice-success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.notice-error {
    background: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* Responsive Design */
@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .site-title {
        font-size: 2em;
        text-align: center;
    }
    
    .auth-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .auth-buttons .btn {
        width: 100%;
    }
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: #fff;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 2px solid #fff;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.3);
}

/* Sekundärer Button für helle Hintergründe */
.btn-secondary-dark {
    background: #fff;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary-dark:hover {
    background: #667eea;
    color: #fff;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Hauptinhalt */
.site-main {
    margin-top: 0;
    padding-top: 40px;

    background: #fff;
    padding: 40px 0;
    min-height: 60vh;
}

.site-main h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 2em;
}

.site-main p {
    font-size: 1.1em;
    line-height: 1.8;
}

/* Suchfeld */
.search-box {
    margin-bottom: 30px;
}

.search-box form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-box input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.search-box input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

/* Suchergebnis-Info */
.search-info {
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #f0f0f0;
    border-radius: 4px;
}

.search-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Filter Panel */
.filter-panel {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-section {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 15px;
    align-items: start;
}

.filter-label {
    font-weight: 600;
    color: #667eea;
    font-size: 16px;
    padding-top: 8px;
}

.filter-select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 42px;
    padding: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #667eea;
    color: white;
    border-radius: 4px;
    font-size: 14px;
}

.filter-tag-remove {
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.filter-tag-remove:hover {
    opacity: 1;
}

.filter-select-inline {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    min-width: 200px;
    flex-shrink: 0;
}

.filter-select-inline:focus {
    outline: none;
    border-color: #667eea;
}

.filter-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    grid-column: 1 / -1;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .filter-section {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .filter-label {
        padding-top: 0;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-actions .btn {
        width: 100%;
    }
}

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

.game-card-link {
    text-decoration: none;
    color: inherit;
}

.game-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.game-image {
    width: 100%;
    height: 200px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.collection-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
}

.btn-collection {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: background 0.2s;
    width: 100%;
    justify-content: center;
}

.btn-collection:hover {
    background: #5568d3;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.game-info {
    padding: 15px;
}

.game-title {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #333;
    font-weight: 600;
    line-height: 1.3;
}

.game-system {
    margin: 5px 0;
    font-size: 0.9em;
    color: #667eea;
    font-weight: 600;
}

.game-year,
.game-developer,
.game-publisher,
.game-ean {
    margin: 3px 0;
    font-size: 0.85em;
    color: #666;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.2em;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.page-number:hover {
    background: #f0f0f0;
    border-color: #667eea;
}

.page-number.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
    font-weight: 600;
}

.page-dots {
    padding: 8px 12px;
    color: #666;
    user-select: none;
}

.page-info {
    font-weight: 600;
    color: #333;
    padding: 0 10px;
}

/* Footer */
.site-footer {
    background: #23282d;
    color: #fff;
    padding: 30px 0;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

.site-footer p {
    text-align: center;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-title {
        font-size: 2em;
    }
    
    .banner-placeholder {
        min-height: 150px;
    }
    
    .site-main h2 {
        font-size: 1.5em;
    }
}

/* Detailansicht */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.game-detail {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.game-detail-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.game-detail-image-section {
    flex-shrink: 0;
    width: 400px;
}

.game-detail-image {
    width: 400px;
    height: 400px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.game-detail-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.thumbnail-item {
    width: 80px;
    height: 80px;
    background: #f5f5f5;
    border: 3px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.thumbnail-item:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.thumbnail-item.active {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.game-detail-main {
    flex: 1;
}

.game-detail-main h2 {
    margin: 0 0 10px 0;
    color: #333;
}

.game-alternative-titles,
.game-additional-title {
    color: #666;
    font-style: italic;
    margin: 5px 0;
}

.game-detail-info {
    margin-top: 20px;
}

.info-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-label {
    font-weight: 600;
    min-width: 200px;
    color: #667eea;
}

.info-value {
    flex: 1;
    color: #333;
}

.game-weblinks {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.game-weblinks h3 {
    margin: 0 0 10px 0;
    color: #667eea;
}

.game-weblinks ul {
    margin: 0;
    padding-left: 20px;
}

.game-weblinks li {
    margin: 5px 0;
}

.game-weblinks a {
    color: #667eea;
    text-decoration: none;
}

.game-weblinks a:hover {
    text-decoration: underline;
}

.game-gallery {
    margin-top: 30px;
}

.game-gallery h3 {
    margin: 0 0 15px 0;
    color: #667eea;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.gallery-item {
    aspect-ratio: 1;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-modal-content {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    padding: 0;
    background: #000;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal-image-container {
    width: 100%;
    height: calc(95vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    position: relative;
}

.gallery-modal-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    cursor: zoom-in;
    transition: none;
    margin: auto;
}

.gallery-modal-content img.zoomed {
    cursor: zoom-out;
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
}

.modal-controls {
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    padding: 15px;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    z-index: 10;
    flex-shrink: 0;
    width: 100%;
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 400px;
}

.zoom-label {
    color: white;
    font-size: 14px;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

.zoom-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #444;
    outline: none;
    -webkit-appearance: none;
}

.zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: background 0.2s;
}

.zoom-slider::-webkit-slider-thumb:hover {
    background: #5568d3;
}

.zoom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.zoom-slider::-moz-range-thumb:hover {
    background: #5568d3;
}

.modal-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
    white-space: nowrap;
}

.modal-btn:hover {
    background: #5568d3;
}

.modal-btn-download {
    background: #28a745;
}

.modal-btn-download:hover {
    background: #218838;
}

@media (max-width: 768px) {
    .game-detail-header {
        flex-direction: column;
    }
    
    .game-detail-image-section {
        width: 100%;
    }
    
    .game-detail-image {
        width: 100%;
        height: 300px;
    }
    
    .image-thumbnails {
        justify-content: center;
    }
    
    .info-row {
        flex-direction: column;
    }
    
    .info-label {
        min-width: auto;
        margin-bottom: 5px;
    }
}

/* Verlinkte Spiele */
.linked-games {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.linked-games h3 {
    font-size: 1.4em;
    margin-bottom: 20px;
    color: #333;
}

.linked-games-system {
    margin-bottom: 30px;
}

.linked-games-system h4 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #667eea;
    font-weight: 600;
}

.linked-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.linked-game-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.linked-game-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.linked-game-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.linked-game-item img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    display: block;
}

.no-image-placeholder {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.85em;
}

.linked-game-info {
    padding: 10px;
}

.linked-game-title {
    font-size: 0.9em;
    font-weight: 500;
    color: #333;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 5px;
}

.linked-game-codes {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 5px;
}

.code-item {
    font-size: 0.75em;
    color: #666;
    text-align: center;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .linked-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .linked-game-item img,
    .no-image-placeholder {
        height: 100px;
    }
    
    .linked-game-info {
        padding: 8px;
    }
    
    .linked-game-title {
        font-size: 0.85em;
    }
    
    .code-item {
        font-size: 0.7em;
    }
}

/* Form Full Width */
.form-group.full-width {
    grid-column: 1 / -1;
}
