/* jeux.css - Styles pour la page des jeux - VERSION RESPONSIVE OPTIMISÉE */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    /* Image de fond ICONIQUE - Manette PlayStation DualShock */
    background-image: url('../images/halo.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Overlay sombre pour lisibilité */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 0;
    pointer-events: none;
}

/* ================== HEADER ================== */
header {
    background-image: url("../images/marvel.jpg");
    background-size: cover;
    background-position: center;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 10;
}

header h1 {
    color: white;
    text-align: center;
    padding: 30px;
    margin: 0;
    font-family: 'Audiowide', cursive;
    font-size: clamp(1.2rem, 4vw, 2rem);
    letter-spacing: clamp(0.2rem, 1vw, 0.5rem);
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
}

.encadrer {
    padding: 7px;
    color: white;
    font-family: 'Audiowide', cursive;
}

/* ================== ICÔNES HEADER ================== */
.home-icon-container {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 20;
}

.user-icon-container {
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 20;
}

.home-icon-link,
.user-icon-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    color: white;
    text-decoration: none;
    font-family: 'Space Mono', monospace;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.home-icon-link:hover,
.user-icon-link:hover {
    background: rgba(213, 2, 65, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-color: #D50241;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(213, 2, 65, 0.5);
}

.home-icon,
.user-icon {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #D50241, #ff1744);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: transform 0.3s ease;
}

.home-icon-link:hover .home-icon,
.user-icon-link:hover .user-icon {
    transform: rotate(360deg);
}

/* ================== NAVIGATION ================== */
.menu {
    height: auto;
    min-height: 60px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-top: #D50241 6px solid;
    border-bottom: #D50241 6px solid;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

ul {
    display: flex;
    justify-content: center;
    padding: 10px;
    gap: clamp(20px, 5vw, 70px);
    list-style: none;
    flex-wrap: wrap;
}

.menu a {
    text-decoration: none;
    color: black;
    font-family: 'Space Mono', sans-serif;
    font-size: clamp(0.85rem, 2vw, 1rem);
    transition: all 0.3s ease;
    padding: 5px 10px;
}

.livre:hover,
#musique:hover,
#films:hover,
#jeux:hover {
    border-bottom: 2px solid #0890E4;
}

#jeux.active {
    border-bottom: 2px solid #D50241;
}

/* ================== CONTAINER PRINCIPAL ================== */
.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: clamp(20px, 4vw, 40px) clamp(10px, 2vw, 20px);
    position: relative;
    z-index: 5;
    flex: 1;
}

.page-header {
    text-align: center;
    margin-bottom: clamp(20px, 4vw, 40px);
    padding: clamp(15px, 3vw, 30px);
}

.page-header h1 {
    color: white;
    font-family: 'Audiowide', cursive;
    font-size: clamp(1.5em, 5vw, 2.5em);
    margin-bottom: 10px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.9);
}

.page-header p {
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.9em, 2.5vw, 1.1em);
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9);
    padding: 0 15px;
}

/* ================== RECHERCHE ET FILTRES ================== */
.search-section {
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 20px;
    max-width: 700px;
    width: calc(100% - 30px);
    padding: clamp(20px, 4vw, 30px);
    margin: 0 auto clamp(25px, 4vw, 40px) auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.2);
    opacity: 0.8;
}

.searchBox {
    display: flex;
    max-width: 100%;
    width: 100%;
    margin: 0 auto 20px auto;
    align-items: center;
    background: white;
    border-radius: 30px;
    padding-right: 15px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    opacity: 0.8;
}

.searchInput {
    border: none;
    background: none;
    outline: none;
    color: black;
    font-size: clamp(14px, 2.5vw, 15px);
    padding: clamp(12px, 2vw, 14px) clamp(20px, 3vw, 26px);
    flex: 1;
    font-family: 'Poppins', sans-serif;
    width: 100%;
}

.filters {
    display: flex;
    justify-content: center;
    gap: clamp(8px, 2vw, 15px);
    flex-wrap: wrap;
    width: 100%;
}

.filter-btn {
    padding: clamp(8px, 1.5vw, 10px) clamp(15px, 3vw, 25px);
    border: 2px solid #D50241;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #D50241;
    border-radius: 25px;
    font-family: 'Space Mono', monospace;
    font-weight: 600;
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-btn:hover {
    background: rgba(213, 2, 65, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(213, 2, 65, 0.3);
}

.filter-btn.active {
    background: linear-gradient(45deg, #D50241, #ff1744);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(213, 2, 65, 0.4);
}

/* ================== ALERTES ================== */
.alert-box {
    padding: clamp(12px, 2vw, 15px) clamp(15px, 3vw, 20px);
    border-radius: 12px;
    margin-bottom: 20px;
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.8em, 2vw, 0.9em);
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.alert-success {
    color: #2e7d32;
    border: 2px solid #66bb6a;
}

.alert-error {
    color: #c62828;
    border: 2px solid #ef5350;
}

/* ================== GRILLE DES JEUX - RESPONSIVE ================== */
.jeux-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: clamp(15px, 2.5vw, 25px);
    margin-bottom: 40px;
    padding: clamp(15px, 4vw, 50px);
}

.game-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(213, 2, 65, 0.4);
    background: rgba(255, 255, 255, 0.85);
    border-color: #D50241;
}

.game-cover {
    position: relative;
    background: linear-gradient(135deg, rgba(213, 2, 65, 0.15), rgba(255, 23, 68, 0.08));
    padding: clamp(25px, 4vw, 40px) clamp(15px, 3vw, 20px);
    text-align: center;
    border-bottom: 2px solid rgba(213, 2, 65, 0.2);
    height: clamp(280px, 35vw, 460px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.no-cover {
    font-size: clamp(3em, 7vw, 4em);
    z-index: 1;
    color: #D50241;
}

.available-badge,
.borrowed-badge {
    position: absolute;
    top: clamp(8px, 1.5vw, 10px);
    right: clamp(8px, 1.5vw, 10px);
    padding: clamp(4px, 1vw, 5px) clamp(12px, 2vw, 15px);
    border-radius: 20px;
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7em, 1.5vw, 0.75em);
    font-weight: bold;
    z-index: 2;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.available-badge {
    background: rgba(232, 245, 233, 0.95);
    color: #2e7d32;
    border: 1px solid #66bb6a;
}

.borrowed-badge {
    background: rgba(255, 235, 238, 0.95);
    color: #c62828;
    border: 1px solid #ef5350;
}

.game-info {
    padding: clamp(15px, 3vw, 20px);
}

.game-title {
    font-family: 'Audiowide', cursive;
    color: #D50241;
    font-size: clamp(1.1em, 2.5vw, 1.3em);
    margin-bottom: 10px;
}

.game-publisher {
    font-family: 'Space Mono', monospace;
    color: #666;
    font-size: clamp(0.85em, 2vw, 0.95em);
    margin-bottom: 15px;
}

.game-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.platform-badge,
.genre-badge {
    padding: clamp(4px, 1vw, 5px) clamp(10px, 2vw, 12px);
    border-radius: 15px;
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7em, 1.6vw, 0.8em);
    font-weight: bold;
}

.platform-badge {
    background: rgba(227, 242, 253, 0.9);
    color: #1976d2;
    border: 1px solid rgba(25, 118, 210, 0.2);
}

.genre-badge {
    background: rgba(243, 229, 245, 0.9);
    color: #7b1fa2;
    border: 1px solid rgba(123, 31, 162, 0.2);
}

.game-year,
.game-pegi,
.game-developer {
    font-family: 'Space Mono', monospace;
    color: #999;
    font-size: clamp(0.75em, 1.8vw, 0.85em);
    margin: 5px 0;
}

.game-stats {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.75em, 1.8vw, 0.85em);
    color: #666;
}

.stat-icon {
    font-size: 1.2em;
}

.game-actions {
    padding: 0 clamp(15px, 3vw, 20px) clamp(15px, 3vw, 20px);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-borrow,
.btn-login,
.btn-unavailable,
.btn-details {
    padding: clamp(10px, 2vw, 12px);
    border: none;
    border-radius: 10px;
    font-family: 'Space Mono', monospace;
    font-weight: bold;
    font-size: clamp(0.8em, 1.8vw, 0.9em);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-borrow {
    background: linear-gradient(45deg, #D50241, #ff1744);
    color: white;
    box-shadow: 0 4px 15px rgba(213, 2, 65, 0.3);
}

.btn-borrow:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(213, 2, 65, 0.5);
}

.btn-login {
    background: linear-gradient(45deg, #0890E4, #0563a8);
    color: white;
    box-shadow: 0 4px 15px rgba(8, 144, 228, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(8, 144, 228, 0.5);
}

.btn-unavailable {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.btn-details {
    background: transparent;
    color: #D50241;
    border: 2px solid #D50241;
    text-decoration: none;
    display: block;
}

.btn-details:hover {
    background: rgba(213, 2, 65, 0.1);
}

.no-games {
    grid-column: 1 / -1;
    text-align: center;
    padding: clamp(40px, 8vw, 60px) clamp(20px, 4vw, 20px);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.no-games h2 {
    font-size: clamp(2.5em, 8vw, 4em);
    margin-bottom: 20px;
}

.no-games p {
    font-family: 'Space Mono', monospace;
    color: #666;
    font-size: clamp(1em, 3vw, 1.2em);
}

/* ================== FOOTER ================== */
footer {
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin-top: clamp(30px, 5vw, 50px);
}

.footer-container {
  position: relative;
  width: 100%;
  height: clamp(80px, 15vw, 120px);
}

.foot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.footer-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  text-align: center;
  padding: 15px;
}

.footer-text h2 {
  color: #ff1744;
  font-family: 'Audiowide', cursive;
  font-size: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: clamp(5px, 1vw, 8px);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.footer-text p {
  font-family: 'Space Mono', sans-serif;
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  line-height: 1.4;
  max-width: 600px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  padding: 0 10px;
}

/* ================== RESPONSIVE BREAKPOINTS ================== */

/* Desktop Large (1600px et plus) */
@media (min-width: 1600px) {
    .jeux-grid {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .game-cover {
        height: 380px;
    }
}

/* Desktop Standard (1200px - 1599px) */
@media (min-width: 1200px) and (max-width: 1599px) {
    .jeux-grid {
        grid-template-columns: repeat(4, 1fr);
        padding: 30px;
    }
    
    .game-cover {
        height: 350px;
    }
}

/* Tablettes Landscape (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .jeux-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 25px;
    }
    
    .game-cover {
        height: 320px;
    }
}

/* Tablettes Portrait (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .jeux-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
        padding: 20px;
    }
    
    .game-cover {
        height: 300px;
    }
    
    .home-icon-container {
        left: 20px;
        top: 25px;
    }

    .user-icon-container {
        right: 20px;
        top: 25px;
    }
    
    header h1 {
        padding: 25px 100px;
    }
}

/* Smartphones Landscape (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .jeux-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 15px;
    }
    
    .game-cover {
        height: 260px;
    }
    
    .home-icon-container {
        left: 15px;
        top: 15px;
    }

    .user-icon-container {
        right: 15px;
        top: 15px;
    }

    .home-icon-link span,
    .user-icon-link span {
        font-size: 12px;
    }

    header h1 {
        padding: 20px 80px;
    }
}

/* Smartphones Portrait (480px - 575px) */
@media (min-width: 480px) and (max-width: 575px) {
    .jeux-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 15px;
    }
    
    .game-cover {
        height: 300px;
    }
    
    .home-icon-link,
    .user-icon-link {
        padding: 8px 15px;
        gap: 8px;
    }
    
    .home-icon-link span,
    .user-icon-link span {
        font-size: 11px;
    }

    header h1 {
        padding: 18px 70px;
    }
}

/* Très petits smartphones (320px - 479px) */
@media (max-width: 479px) {
    .jeux-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }
    
    .game-cover {
        height: 280px;
    }
    
    .home-icon-container {
        left: 10px;
        top: 15px;
    }

    .user-icon-container {
        right: 10px;
        top: 15px;
    }

    .home-icon-link,
    .user-icon-link {
        padding: 8px;
        border-radius: 50%;
        gap: 0;
    }
    
    .home-icon-link span,
    .user-icon-link span {
        display: none;
    }
    
    .home-icon,
    .user-icon {
        width: 24px;
        height: 24px;
        font-size: 13px;
    }

    header h1 {
        padding: 15px 50px;
        font-size: 1rem;
    }

    ul {
        gap: 10px;
        padding: 10px 5px;
        justify-content: space-around;
    }
    
    .menu a {
        padding: 6px 8px;
        font-size: 0.8rem;
    }
}

/* Extra petits écrans (max 359px) */
@media (max-width: 359px) {
    .jeux-grid {
        padding: 8px;
        gap: 12px;
    }
    
    .game-cover {
        height: 240px;
    }
    
    header h1 {
        padding: 12px 45px;
        font-size: 0.9rem;
        letter-spacing: 0.15rem;
    }
    
    .page-header h1 {
        font-size: 1.3em;
    }
    
    .page-header p {
        font-size: 0.85em;
    }
    
    .menu {
        border-top-width: 4px;
        border-bottom-width: 4px;
    }
    
    ul {
        gap: 8px;
        padding: 8px 5px;
    }
    
    .menu a {
        font-size: 0.75rem;
        padding: 5px 6px;
    }
}

/* Optimisations pour écrans tactiles */
@media (hover: none) and (pointer: coarse) {
    .game-card:hover {
        transform: none;
    }
    
    .btn-borrow:hover,
    .btn-login:hover,
    .btn-details:hover {
        transform: none;
    }
    
    .filter-btn:hover {
        transform: none;
    }
    
    /* Augmentation des zones tactiles */
    .btn-borrow,
    .btn-login,
    .btn-unavailable,
    .btn-details {
        min-height: 44px;
    }
    
    .filter-btn {
        min-height: 40px;
    }
    
    .menu a {
        min-height: 40px;
        display: flex;
        align-items: center;
    }
}

/* Mode paysage pour smartphones */
@media (max-height: 500px) and (orientation: landscape) {
    .game-cover {
        height: 200px;
    }
    
    header h1 {
        padding: 15px 60px;
        font-size: 1.1rem;
    }
    
    .page-header {
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .search-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .jeux-grid {
        padding: 15px;
        gap: 15px;
    }
    
    .footer-container {
        height: 70px;
    }
}

/* Optimisation pour iPad et tablettes */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .jeux-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .game-cover {
        height: 300px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .jeux-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .game-cover {
        height: 280px;
    }
}

/* Accessibility - Préférence de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .game-card:hover,
    .btn-borrow:hover,
    .btn-login:hover,
    .btn-details:hover,
    .filter-btn:hover {
        transform: none;
    }
    
    .home-icon-link:hover .home-icon,
    .user-icon-link:hover .user-icon {
        transform: none;
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .game-cover img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Print styles */
@media print {
    .home-icon-container,
    .user-icon-container,
    .menu,
    .search-section,
    .filters,
    .game-actions,
    footer {
        display: none;
    }
    
    body::before {
        display: none;
    }
    
    .game-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}