/**
 * ZAM Game Comparatif - Frontend Styles v2
 * Layout inspiré de zam-game.com/comparatif
 */

/* Main Container */
.zam-game-display {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Game Image Header (replaces title when image exists) */
.zam-game-image-header {
    text-align: center;
    margin-bottom: 30px;
}

.zam-game-image-header img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Game Title Header (when no image) */
.zam-game-title-header {
    text-align: center;
    margin: 0 0 30px 0;
    font-size: 2.5em;
    color: #333;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

/* Comparatif Table Layout (3 columns: Description | Rating | Categories) */
.zam-game-comparatif-table {
    margin-bottom: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.zam-comparatif-row {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 0;
    border: 2px solid #e0e0e0;
}

/* Left Column: Description */
.zam-comparatif-description {
    padding: 30px;
    background: #f8f9fa;
    border-right: 2px solid #e0e0e0;
    line-height: 1.8;
    color: #333;
}

.zam-comparatif-description p {
    margin-bottom: 15px;
}

.zam-game-attributes-inline {
    margin-top: 20px;
}

.zam-attribute-item {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.zam-attribute-item:last-child {
    border-bottom: none;
}

.zam-attribute-item strong {
    color: #667eea;
    margin-right: 5px;
}

/* Center Column: Global Rating */
.zam-comparatif-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-right: 2px solid #e0e0e0;
}

.zam-rating-box {
    text-align: center;
    color: white;
}

.zam-rating-value {
    font-size: 3.5em;
    font-weight: bold;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.zam-rating-max {
    font-size: 0.5em;
    opacity: 0.9;
}

.zam-rating-votes {
    margin-top: 10px;
    font-size: 0.9em;
    opacity: 0.95;
}

/* Right Column: Categories */
.zam-comparatif-categories {
    padding: 30px;
    background: #fff;
}

.zam-categories-title {
    margin: 0 0 20px 0;
    font-size: 1.3em;
    color: #333;
    border-bottom: 2px solid #667eea;
    padding-bottom: 10px;
}

.zam-categories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zam-category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.zam-category-item:last-child {
    border-bottom: none;
}

.zam-category-name {
    font-weight: 500;
    color: #555;
    min-width: 150px;
    font-size: 0.95em;
}

.zam-category-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 18px;
}

.zam-star {
    line-height: 1;
}

.zam-star.filled {
    color: #FFD700;
}

.zam-star.empty {
    color: #ddd;
}

.zam-star.empty {
    color: #ddd;
}

.zam-category-average {
    margin-left: 10px;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

/* Rating Form */
.zam-rating-form-container {
    margin-bottom: 30px;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.zam-rating-form-container h3 {
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #333;
}

.zam-rating-form {
    max-width: 600px;
}

.zam-form-section {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 2px solid #eee;
}

.zam-form-section h4 {
    margin-bottom: 15px;
    color: #444;
}

.zam-form-field {
    margin-bottom: 20px;
}

.zam-category-rating-field {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
}

.zam-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.zam-stars-input {
    font-size: 28px;
    letter-spacing: 3px;
    cursor: pointer;
}

.zam-star-input {
    color: #ddd;
    transition: color 0.2s ease;
}

.zam-star-input:hover,
.zam-star-input.active {
    color: #FFD700;
}

.zam-form-field select,
.zam-form-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.zam-form-field select:focus,
.zam-form-field textarea:focus {
    outline: none;
    border-color: #4CAF50;
}

.zam-submit-rating {
    padding: 12px 30px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.zam-submit-rating:hover {
    background: #45a049;
}

.zam-submit-rating:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.zam-form-message {
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 4px;
    display: none;
}

.zam-form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.zam-form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Recent Ratings */
.zam-recent-ratings {
    margin-bottom: 30px;
}

.zam-recent-ratings h3 {
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #333;
}

.zam-rating-item {
    padding: 20px;
    margin-bottom: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.zam-rating-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.zam-rating-author {
    font-weight: 600;
    color: #333;
}

.zam-rating-date {
    color: #999;
    font-size: 14px;
}

.zam-rating-scores {
    margin-bottom: 10px;
}

.zam-rating-global-badge {
    display: inline-block;
    padding: 5px 12px;
    background: #4CAF50;
    color: white;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
}

.zam-rating-categories-small {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.zam-cat-rating-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 3px;
    font-size: 12px;
    color: #555;
}

.zam-rating-comment {
    padding: 10px;
    background: #f8f9fa;
    border-left: 3px solid #4CAF50;
    color: #555;
    line-height: 1.6;
    margin-top: 10px;
}

.zam-load-more-ratings {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    background: white;
    border: 2px solid #4CAF50;
    color: #4CAF50;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zam-load-more-ratings:hover {
    background: #4CAF50;
    color: white;
}

/* Games List */
.zam-games-list {
    padding: 20px;
}

.zam-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.zam-game-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.zam-game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.zam-game-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.zam-game-card-content {
    padding: 20px;
}

.zam-game-card-title {
    margin: 0 0 15px 0;
    font-size: 1.3em;
    color: #333;
}

.zam-game-card-rating {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.zam-global-rating-card {
    font-size: 18px;
    color: #4CAF50;
}

.zam-categories-preview {
    margin-bottom: 15px;
}

.zam-category-mini {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.zam-cat-name {
    font-weight: 600;
    color: #333;
}

.zam-view-game {
    display: inline-block;
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.zam-view-game:hover {
    background: #45a049;
    color: white;
}

/* Responsive */
@media (max-width: 992px) {
    /* Tablet: stack in 2 columns then 1 */
    .zam-comparatif-row {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .zam-comparatif-description,
    .zam-comparatif-rating,
    .zam-comparatif-categories {
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
    }
    
    .zam-comparatif-categories {
        border-bottom: none;
    }
    
    .zam-comparatif-rating {
        padding: 20px;
    }
    
    .zam-rating-value {
        font-size: 2.5em;
    }
}

@media (max-width: 768px) {
    .zam-game-display {
        padding: 15px;
    }
    
    .zam-comparatif-description,
    .zam-comparatif-rating,
    .zam-comparatif-categories {
        padding: 20px;
    }
    
    .zam-rating-value {
        font-size: 2em;
    }
    
    .zam-game-title-header {
        font-size: 1.8em;
        padding: 15px;
    }
    
    .zam-games-grid {
        grid-template-columns: 1fr;
    }
    
    .zam-category-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ========================================
   GAMES LISTING VIEW (nouveau shortcode)
   ======================================== */

.zam-games-listing {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.zam-listing-item {
    margin-bottom: 50px;
}

.zam-listing-item:last-child {
    margin-bottom: 0;
}

/* Listing Image (max 250px, sans bordure) */
.zam-listing-image {
    text-align: center;
    margin-bottom: 20px;
}

.zam-listing-image img {
    max-width: 250px;
    height: auto;
    display: inline-block;
}

/* Listing Title (when no image) */
.zam-listing-title {
    text-align: center;
    margin: 0 0 20px 0;
    font-size: 2em;
    color: #333;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

/* Listing Comparatif Table (3 columns) */
.zam-listing-comparatif {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

.zam-listing-row {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 0;
    border: 2px solid #e0e0e0;
}

/* Left Column: Description */
.zam-listing-description {
    padding: 25px;
    background: #f8f9fa;
    border-right: 2px solid #e0e0e0;
    line-height: 1.7;
    color: #333;
    font-size: 0.95em;
}

.zam-listing-description p {
    margin-bottom: 12px;
}

.zam-listing-attributes {
    margin-top: 15px;
}

.zam-listing-attribute {
    margin-bottom: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.9em;
}

.zam-listing-attribute:last-child {
    border-bottom: none;
}

.zam-listing-attribute strong {
    color: #667eea;
    margin-right: 5px;
}

/* Center Column: Global Rating */
.zam-listing-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-right: 2px solid #e0e0e0;
}

.zam-listing-rating-box {
    text-align: center;
    color: white;
}

.zam-listing-rating-value {
    font-size: 3em;
    font-weight: bold;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.zam-listing-rating-max {
    font-size: 0.5em;
    opacity: 0.9;
}

.zam-listing-rating-votes {
    margin-top: 8px;
    font-size: 0.85em;
    opacity: 0.95;
}

/* Right Column: Categories (sans titre) */
.zam-listing-categories {
    padding: 25px;
    background: #fff;
}

.zam-listing-categories-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zam-listing-category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #e0e0e0;
}

.zam-listing-category-item:last-child {
    border-bottom: none;
}

.zam-listing-category-name {
    font-weight: 500;
    color: #555;
    min-width: 150px;
    font-size: 0.9em;
}

.zam-listing-category-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 16px;
}

/* Responsive for Listing */
@media (max-width: 992px) {
    .zam-listing-row {
        grid-template-columns: 1fr;
    }
    
    .zam-listing-description,
    .zam-listing-rating,
    .zam-listing-categories {
        border-right: none;
        border-bottom: 2px solid #e0e0e0;
    }
    
    .zam-listing-categories {
        border-bottom: none;
    }
    
    .zam-listing-rating {
        padding: 20px;
    }
    
    .zam-listing-rating-value {
        font-size: 2.5em;
    }
}

@media (max-width: 768px) {
    .zam-games-listing {
        padding: 15px;
    }
    
    .zam-listing-description,
    .zam-listing-rating,
    .zam-listing-categories {
        padding: 20px;
    }
    
    .zam-listing-rating-value {
        font-size: 2em;
    }
    
    .zam-listing-title {
        font-size: 1.5em;
        padding: 12px;
    }
    
    .zam-listing-image img {
        max-width: 200px;
    }
}
