/**
 * KORYA - Styles spécifiques à la page d'accueil
 * Version: 2.0.0
 */

/* ============================================
   FIX: PREVENT HORIZONTAL SCROLL
   ============================================ */
html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
}

* {
    max-width: 100%;
    box-sizing: border-box;
}

img, video, iframe, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   NOTIFICATION VIDÉO FLOTTANTE BOTTOM-RIGHT
   ============================================ */
.video-notification-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    pointer-events: none;
}

@media (max-width: 768px) {
    .video-notification-container {
        bottom: 80px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}

.video-notification {
    pointer-events: auto;
    width: 360px;
    background: var(--bg-card, #1a1a2e);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 102, 204, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 102, 204, 0.5);
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@media (max-width: 768px) {
    .video-notification {
        width: 100%;
        max-width: 360px;
        margin-left: auto;
        margin-right: 0;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .video-notification {
        max-width: 100%;
        border-radius: 12px;
    }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

.video-notification.hide {
    animation: slideOutRight 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.notification-video-container {
    position: relative;
    cursor: pointer;
    background: #000;
}

.notification-video-container video {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.notification-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: linear-gradient(135deg, #ff0066, #ff4444);
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 2;
    animation: pulse 1s infinite;
}

@media (max-width: 480px) {
    .notification-badge {
        font-size: 10px;
        padding: 3px 8px;
        top: 8px;
        left: 8px;
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

.notification-badge i { margin-right: 5px; }

.notification-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 2;
    transition: all 0.2s ease;
    border: none;
    font-size: 14px;
}

@media (max-width: 480px) {
    .notification-close {
        width: 26px;
        height: 26px;
        font-size: 12px;
        top: 6px;
        right: 6px;
    }
}

.notification-close:hover {
    background: rgba(255, 68, 68, 0.9);
    transform: scale(1.1);
}

.notification-info {
    padding: 12px 15px;
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.1), rgba(0, 102, 204, 0.05));
}

.notification-info h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-light, #fff);
}

@media (max-width: 480px) {
    .notification-info h4 {
        font-size: 13px;
    }
}

.notification-info h4 a {
    color: inherit;
    text-decoration: none;
}

.notification-info h4 a:hover { 
    color: var(--primary, #0066cc); 
}

.notification-info p {
    margin: 0;
    font-size: 12px;
    color: var(--text-gray, #888);
}

@media (max-width: 480px) {
    .notification-info p {
        font-size: 11px;
    }
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary, #0066cc), #00aaff);
    width: 100%;
    animation: progressBar 5s linear forwards;
}

@keyframes progressBar {
    from { width: 100%; }
    to { width: 0%; }
}

/* ============================================
   CARROUSEL STYLES AMÉLIORÉS
   ============================================ */
.carousel-container {
    position: relative;
    overflow: hidden;
    padding: 0 25px;
    margin: 20px 0;
}

@media (min-width: 768px) {
    .carousel-container {
        padding: 0 60px;
        margin: 40px 0;
    }
}

.carousel-wrapper {
    overflow: hidden;
    margin: 0 -5px;
}

@media (min-width: 768px) {
    .carousel-wrapper {
        margin: 0 -10px;
    }
}

.carousel-track {
    display: flex;
    transition: transform 0.3s ease-in-out;
    gap: 15px;
}

@media (min-width: 768px) {
    .carousel-track {
        gap: 25px;
    }
}

.carousel-slide {
    flex: 0 0 auto;
    width: calc(50% - 8px);
    min-width: 0;
}

@media (min-width: 480px) {
    .carousel-slide {
        width: calc(50% - 8px);
    }
}

@media (min-width: 768px) {
    .carousel-slide {
        width: calc(33.33% - 17px);
    }
}

@media (min-width: 992px) {
    .carousel-slide {
        width: calc(25% - 19px);
    }
}

@media (min-width: 1200px) {
    .carousel-slide {
        width: calc(20% - 20px);
    }
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: var(--bg-card, #1a1a2e);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 14px;
}

@media (min-width: 768px) {
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

.carousel-btn:hover {
    background: var(--primary, #0066cc);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn { 
    left: -5px; 
}

@media (min-width: 768px) {
    .prev-btn { 
        left: 10px; 
    }
}

.next-btn { 
    right: -5px; 
}

@media (min-width: 768px) {
    .next-btn { 
        right: 10px; 
    }
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

@media (min-width: 768px) {
    .carousel-dots {
        gap: 10px;
        margin-top: 20px;
    }
}

.dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .dot {
        width: 10px;
        height: 10px;
    }
}

.dot.active {
    background: var(--primary, #0066cc);
    width: 20px;
    border-radius: 4px;
}

@media (min-width: 768px) {
    .dot.active {
        width: 24px;
    }
}

.dot:hover {
    background: var(--primary, #0066cc);
}

/* ============================================
   HERO SECTION RESPONSIVE
   ============================================ */
.hero-section {
    padding: 60px 0 40px;
}

@media (min-width: 768px) {
    .hero-section {
        padding: 100px 0 60px;
    }
}

.hero-section h1 {
    font-size: 2rem;
}

@media (min-width: 768px) {
    .hero-section h1 {
        font-size: 3rem;
    }
}

@media (min-width: 992px) {
    .hero-section h1 {
        font-size: 3.5rem;
    }
}

.hero-section p {
    font-size: 1rem;
}

@media (min-width: 768px) {
    .hero-section p {
        font-size: 1.2rem;
    }
}

.hero-search {
    padding: 0 10px;
}

@media (max-width: 480px) {
    .hero-search {
        padding: 0;
    }
}

.hero-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 10px;
}

@media (max-width: 480px) {
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .hero-buttons .btn {
        width: 90%;
        max-width: 280px;
        text-align: center;
    }
}

@media (min-width: 768px) {
    .hero-buttons {
        gap: 20px;
        padding: 0;
    }
}

/* ============================================
   SECTIONS RESPONSIVE
   ============================================ */
.popular-section,
.new-releases {
    padding: 30px 0;
}

@media (min-width: 768px) {
    .popular-section,
    .new-releases {
        padding: 60px 0;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

@media (max-width: 480px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

.section-header h2 {
    font-size: 1.4rem;
    margin: 0;
}

@media (min-width: 768px) {
    .section-header h2 {
        font-size: 2rem;
    }
}

.view-all {
    font-size: 14px;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .view-all {
        font-size: 16px;
    }
}

/* ============================================
   GENRES SECTION RESPONSIVE
   ============================================ */
.genres-section {
    padding: 40px 0;
}

@media (min-width: 768px) {
    .genres-section {
        padding: 80px 0;
    }
}

.genres-section h2 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .genres-section h2 {
        font-size: 2rem;
        margin-bottom: 40px;
    }
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 480px) {
    .genre-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (min-width: 768px) {
    .genre-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 992px) {
    .genre-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 25px;
    }
}

.genre-item {
    aspect-ratio: 1;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.4s;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: white;
    padding: 15px 10px;
    min-height: 80px;
}

@media (min-width: 768px) {
    .genre-item {
        font-size: 1.3rem;
        padding: 20px;
        min-height: 120px;
        border-radius: 20px;
    }
}

.genre-item i {
    font-size: 24px;
    margin-bottom: 5px;
}

@media (min-width: 768px) {
    .genre-item i {
        font-size: 36px;
        margin-bottom: 10px;
    }
}

.genre-item span {
    font-size: 13px;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    transition: transform 0.3s;
}

@media (min-width: 768px) {
    .genre-item span {
        font-size: 16px;
    }
}

.genre-item small {
    font-size: 10px;
    opacity: 0.8;
    font-weight: 400;
    position: relative;
    z-index: 2;
}

@media (min-width: 768px) {
    .genre-item small {
        font-size: 12px;
    }
}

.genre-item:hover span {
    transform: scale(1.1);
}

/* ============================================
   ARTISTES SECTION RESPONSIVE
   ============================================ */
.trending-artists {
    padding: 40px 0;
}

@media (min-width: 768px) {
    .trending-artists {
        padding: 80px 0;
    }
}

.artist-card {
    padding: 20px 15px;
}

@media (min-width: 768px) {
    .artist-card {
        padding: 30px 20px;
    }
}

.artist-image {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
}

@media (min-width: 768px) {
    .artist-image {
        width: 150px;
        height: 150px;
        margin: 0 auto 20px;
    }
}

.artist-card h4 {
    font-size: 1rem;
}

@media (min-width: 768px) {
    .artist-card h4 {
        font-size: 1.2rem;
    }
}

.artist-card p {
    font-size: 0.8rem;
}

@media (min-width: 768px) {
    .artist-card p {
        font-size: 0.95rem;
    }
}

/* ============================================
   CTA SECTION RESPONSIVE
   ============================================ */
.cta-section {
    padding: 40px 0;
}

@media (min-width: 768px) {
    .cta-section {
        padding: 100px 0;
    }
}

.cta-content h2 {
    font-size: 1.6rem;
}

@media (min-width: 768px) {
    .cta-content h2 {
        font-size: 2.5rem;
    }
}

.cta-content p {
    font-size: 1rem;
}

@media (min-width: 768px) {
    .cta-content p {
        font-size: 1.2rem;
    }
}

.cta-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 480px) {
    .cta-features {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (min-width: 768px) {
    .cta-features {
        gap: 30px;
    }
}

.feature {
    padding: 15px;
}

@media (min-width: 768px) {
    .feature {
        padding: 20px;
    }
}

.feature span:first-child {
    font-size: 2rem;
}

@media (min-width: 768px) {
    .feature span:first-child {
        font-size: 3rem;
    }
}

.feature span:last-child {
    font-size: 0.9rem;
}

@media (min-width: 768px) {
    .feature span:last-child {
        font-size: 1.1rem;
    }
}

.btn-cta {
    padding: 12px 30px;
    font-size: 1rem;
}

@media (min-width: 768px) {
    .btn-cta {
        padding: 15px 50px;
        font-size: 1.2rem;
    }
}

/* ============================================
   MUSIC CARDS RESPONSIVE
   ============================================ */
.music-card {
    border-radius: 12px;
}

@media (min-width: 768px) {
    .music-card {
        border-radius: 15px;
    }
}

.music-card-info {
    padding: 12px 15px;
}

@media (min-width: 768px) {
    .music-card-info {
        padding: 20px;
    }
}

.music-card-info h3 {
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .music-card-info h3 {
        font-size: 1.1rem;
    }
}

.artist-name {
    font-size: 0.8rem;
}

@media (min-width: 768px) {
    .artist-name {
        font-size: 0.9rem;
    }
}

.price {
    font-size: 1rem;
}

@media (min-width: 768px) {
    .price {
        font-size: 1.2rem;
    }
}

.btn-buy-small {
    padding: 6px 14px;
    font-size: 0.75rem;
}

@media (min-width: 768px) {
    .btn-buy-small {
        padding: 8px 20px;
        font-size: 0.85rem;
    }
}

.new-badge {
    top: 10px;
    left: 10px;
    padding: 3px 10px;
    font-size: 10px;
}

@media (min-width: 768px) {
    .new-badge {
        top: 15px;
        left: 15px;
        padding: 5px 15px;
        font-size: 12px;
    }
}

/* ============================================
   VIDÉOS GRID RESPONSIVE
   ============================================ */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

@media (min-width: 768px) {
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 25px;
        margin: 30px 0;
    }
}

.video-card {
    background: var(--bg-card, #111);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

@media (min-width: 768px) {
    .video-card {
        border-radius: 16px;
    }
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.video-card-image {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.video-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card:hover .video-card-image img {
    transform: scale(1.05);
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (min-width: 768px) {
    .play-overlay {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

.video-card:hover .play-overlay {
    opacity: 1;
}

.video-card-info {
    padding: 10px 12px;
}

@media (min-width: 768px) {
    .video-card-info {
        padding: 12px 15px;
    }
}

.video-card-info h4 {
    margin: 0 0 5px 0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 768px) {
    .video-card-info h4 {
        font-size: 15px;
    }
}

.video-card-info p {
    margin: 0;
    font-size: 11px;
    color: var(--text-gray, #888);
}

@media (min-width: 768px) {
    .video-card-info p {
        font-size: 12px;
    }
}

/* ============================================
   RECOMMANDATIONS
   ============================================ */
.recommendations-section {
    background: linear-gradient(135deg, rgba(0, 102, 204, 0.05), transparent);
    border-radius: 20px;
    padding: 15px 0;
    margin: 15px 0;
}

@media (min-width: 768px) {
    .recommendations-section {
        border-radius: 24px;
        padding: 20px 0;
        margin: 20px 0;
    }
}

.badge-personalized {
    background: linear-gradient(135deg, #0066cc, #00aaff);
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: 10px;
    display: inline-block;
}

@media (min-width: 768px) {
    .badge-personalized {
        font-size: 12px;
        padding: 4px 12px;
        margin-left: 15px;
    }
}

/* ============================================
   RESPONSIVE GLOBAL
   ============================================ */

/* Tablettes et petits écrans */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-section h1 {
        font-size: 28px;
    }
    
    .hero-section p {
        font-size: 15px;
    }
    
    .section-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .genre-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .genre-item {
        padding: 15px;
        min-height: 70px;
    }
    
    .genre-item i {
        font-size: 22px;
    }
    
    .genre-item span {
        font-size: 12px;
    }
    
    .genre-item small {
        font-size: 9px;
    }
    
    .cta-features {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .cta-features .feature {
        width: 100%;
        max-width: 300px;
    }
}

/* Mobiles */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .hero-section {
        padding: 40px 0 30px;
    }
    
    .hero-section h1 {
        font-size: 22px;
    }
    
    .hero-section p {
        font-size: 14px;
    }
    
    .search-form-large input {
        font-size: 14px;
        padding: 12px 15px;
        border-radius: 25px;
        width: 100%;
    }
    
    .search-form-large button {
        font-size: 14px;
        padding: 12px 15px;
        border-radius: 25px;
        width: 100%;
    }
    
    .genre-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .genre-item {
        padding: 12px 8px;
        min-height: 60px;
        border-radius: 12px;
    }
    
    .genre-item i {
        font-size: 20px;
        margin-bottom: 3px;
    }
    
    .genre-item span {
        font-size: 11px;
    }
    
    .genre-item small {
        font-size: 8px;
    }
    
    .music-card h3 {
        font-size: 13px;
    }
    
    .artist-card h4 {
        font-size: 13px;
    }
    
    .price {
        font-size: 14px;
    }
    
    .btn-buy-small {
        padding: 4px 10px;
        font-size: 10px;
    }
    
    .section-header h2 {
        font-size: 18px;
    }
    
    .view-all {
        font-size: 12px;
    }
    
    .cta-content h2 {
        font-size: 20px;
    }
    
    .cta-content p {
        font-size: 14px;
    }
    
    .feature {
        padding: 12px;
    }
    
    .feature span:first-child {
        font-size: 24px;
    }
    
    .feature span:last-child {
        font-size: 13px;
    }
    
    .btn-cta {
        padding: 10px 24px;
        font-size: 14px;
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
}

/* Très petits écrans */
@media (max-width: 360px) {
    .container {
        padding: 0 8px;
    }
    
    .hero-section h1 {
        font-size: 18px;
    }
    
    .genre-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .genre-item {
        padding: 10px 6px;
        min-height: 50px;
        border-radius: 10px;
    }
    
    .genre-item i {
        font-size: 16px;
    }
    
    .genre-item span {
        font-size: 10px;
    }
    
    .genre-item small {
        display: none;
    }
    
    .music-card-info {
        padding: 8px 10px;
    }
    
    .music-card-info h3 {
        font-size: 11px;
    }
    
    .artist-name {
        font-size: 10px;
    }
    
    .price {
        font-size: 12px;
    }
    
    .btn-buy-small {
        padding: 3px 8px;
        font-size: 9px;
    }
}

/* ============================================
   ANIMATIONS ET TRANSITIONS
   ============================================ */
.music-card,
.artist-card,
.video-card,
.genre-item {
    transition: all 0.3s ease;
}

.music-card:hover,
.artist-card:hover,
.video-card:hover {
    transform: translateY(-5px);
}

@media (min-width: 768px) {
    .music-card:hover,
    .artist-card:hover,
    .video-card:hover {
        transform: translateY(-10px);
    }
}

/* ============================================
   ACCESSIBILITÉ
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible pour la navigation clavier */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary, #0066cc);
    outline-offset: 2px;
}

/* ============================================
   UTILITAIRES RESPONSIVE
   ============================================ */
.hide-on-mobile {
    display: inline;
}

@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }
}

.hide-on-desktop {
    display: none;
}

@media (max-width: 768px) {
    .hide-on-desktop {
        display: inline;
    }
}

.text-center-mobile {
    text-align: left;
}

@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center;
    }
}

.flex-center-mobile {
    justify-content: flex-start;
}

@media (max-width: 768px) {
    .flex-center-mobile {
        justify-content: center;
    }
}