/**
 * Mobile Responsive CSS
 * Optimisation complete pour mobile (< 768px)
 */

/* ============================================
   BREAKPOINTS
   ============================================ */
/* Mobile: < 768px */
/* Tablet: 768px - 1024px */
/* Desktop: > 1024px */

/* ============================================
   CALCULATORS MOBILE OPTIMIZATION
   ============================================ */

@media (max-width: 767px) {
	/* Damage Calculator */
	form[action*="calculator"] div[style*="grid-template-columns"] {
		grid-template-columns: 1fr !important;
	}

	/* Experience Calculator */
	.vertical-table {
		font-size: 12px;
	}

	.vertical-table th,
	.vertical-table td {
		padding: 6px 4px !important;
	}

	/* Cacher certaines colonnes sur mobile */
	.vertical-table th:nth-child(7),
	.vertical-table td:nth-child(7),
	.vertical-table th:nth-child(8),
	.vertical-table td:nth-child(8) {
		display: none;
	}

	/* Stats Calculator - Grids responsive */
	div[style*="grid-template-columns: repeat(2"] {
		grid-template-columns: 1fr !important;
	}

	/* Element Resistance Table */
	.element-resistance-table {
		font-size: 10px;
		overflow-x: auto;
	}

	.element-resistance-table th,
	.element-resistance-table td {
		padding: 4px 2px !important;
		min-width: 40px;
	}

	/* Advanced Stats Cards */
	div[style*="grid-template-columns: repeat(auto-fit"] {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

/* ============================================
   NAVIGATION MOBILE
   ============================================ */

/* CACHER PAR DEFAUT sur desktop */
.mobile-menu-toggle,
.mobile-menu-overlay,
.mobile-menu {
    display: none !important;
}

@media (max-width: 767px) {
    /* Menu horizontal devient vertical sur mobile */
    .retro-header-nav {
        display: none !important; /* Cache le menu desktop */
    }

    /* Bouton hamburger mobile */
    .mobile-menu-toggle {
        display: block !important;
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 1000;
        background: var(--color-primary);
        color: white;
        border: none;
        padding: 12px 15px;
        border-radius: 8px;
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
    
    .mobile-menu-toggle i {
        font-size: 20px;
    }
    
    /* Menu mobile overlay */
    .mobile-menu-overlay {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }

    .mobile-menu-overlay.active {
        display: block !important;
    }

    /* Menu mobile sidebar */
    .mobile-menu {
        display: block !important;
        position: fixed;
        top: 0;
        right: -300px;
        width: 280px;
        height: 100%;
        background: white;
        z-index: 1001;
        transition: right 0.3s ease;
        overflow-y: auto;
        box-shadow: -2px 0 8px rgba(0,0,0,0.2);
    }

    .mobile-menu.active {
        right: 0;
    }
    
    .mobile-menu-header {
        padding: 20px;
        background: var(--color-primary);
        color: white;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        color: white;
        font-size: 24px;
        cursor: pointer;
    }
    
    .mobile-menu-items {
        padding: 0;
        margin: 0;
        list-style: none;
    }
    
    .mobile-menu-category {
        border-bottom: 1px solid var(--color-border);
    }
    
    .mobile-menu-category-label {
        display: block;
        padding: 15px 20px;
        background: var(--color-bg-alt);
        font-weight: 600;
        color: var(--color-primary);
        cursor: pointer;
    }
    
    .mobile-menu-category-items {
        display: none;
        padding: 0;
        margin: 0;
        list-style: none;
        background: white;
    }
    
    .mobile-menu-category.active .mobile-menu-category-items {
        display: block;
    }
    
    .mobile-menu-item {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .mobile-menu-item a {
        display: block;
        padding: 12px 20px 12px 40px;
        color: var(--color-text-primary);
        text-decoration: none;
    }
    
    .mobile-menu-item a.active {
        background: var(--color-bg-alt);
        color: var(--color-primary);
        font-weight: 600;
    }
}

/* ============================================
   HEADER MOBILE
   ============================================ */
@media (max-width: 767px) {
    .retro-header {
        padding: 10px 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .retro-header-logo {
        font-size: 20px;
        text-align: center;
    }
    
    .retro-header-user {
        font-size: 13px;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* ============================================
   BREADCRUMBS MOBILE
   ============================================ */
@media (max-width: 767px) {
    .breadcrumbs {
        padding: 10px 15px;
        font-size: 12px;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .breadcrumbs a,
    .breadcrumbs span {
        font-size: 12px;
    }
}

/* ============================================
   TABS NAVIGATION MOBILE
   ============================================ */
@media (max-width: 767px) {
    .tabs-navigation {
        margin-bottom: 15px;
    }
    
    .tabs-nav {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 5px;
        padding: 5px;
        background: var(--color-bg-alt);
        border-radius: 8px;
    }
    
    .tabs-nav::-webkit-scrollbar {
        height: 4px;
    }
    
    .tabs-nav::-webkit-scrollbar-thumb {
        background: var(--color-primary);
        border-radius: 2px;
    }
    
    .tab-btn {
        flex: 0 0 auto;
        min-width: 120px;
        padding: 10px 15px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .tab-btn i {
        display: none; /* Cache les icones sur mobile pour gagner de la place */
    }
}

/* ============================================
   CARDS MOBILE
   ============================================ */
@media (max-width: 767px) {
    .retro-card,
    .retro-card-gold {
        margin-bottom: 15px;
        padding: 15px;
        border-radius: 8px;
    }
    
    .retro-card-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    /* Cards avec header et boutons */
    .retro-card-gold > div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    .retro-card-gold h2 {
        font-size: 18px !important;
    }
    
    .retro-card-gold p {
        font-size: 13px !important;
    }
    
    /* Boutons admin en colonne sur mobile */
    .retro-card-gold div[style*="display: flex"][style*="gap"] {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .retro-card-gold .retro-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   WIDGETS STATS SERVEUR MOBILE
   ============================================ */
@media (max-width: 767px) {
    .server-stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .stat-widget {
        padding: 15px !important;
    }
    
    .stat-widget-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 24px !important;
    }
    
    .stat-widget-value {
        font-size: 24px !important;
    }
    
    .stat-widget-label {
        font-size: 12px !important;
    }
}

/* ============================================
   NEWS CAROUSEL MOBILE
   ============================================ */
@media (max-width: 767px) {
    .news-carousel {
        margin-bottom: 15px;
    }

    .carousel-slide {
        padding: 20px 15px !important;
        min-height: 200px !important;
    }

    .carousel-content h3 {
        font-size: 18px !important;
        margin-bottom: 10px !important;
    }

    .carousel-content .carousel-meta {
        font-size: 11px !important;
        margin-bottom: 10px !important;
    }

    .carousel-content p {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }

    .carousel-nav {
        bottom: 10px !important;
    }

    .carousel-nav-btn {
        width: 35px !important;
        height: 35px !important;
        font-size: 16px !important;
    }

    .carousel-indicators {
        bottom: 10px !important;
        gap: 6px !important;
    }

    .carousel-indicator {
        width: 8px !important;
        height: 8px !important;
    }
}

/* ============================================
   EVENTS SECTION MOBILE
   ============================================ */
@media (max-width: 767px) {
    .events-section {
        margin-bottom: 15px;
    }

    .events-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .event-card {
        padding: 15px !important;
    }

    .event-card-header h4 {
        font-size: 16px !important;
    }

    .event-card-date {
        font-size: 12px !important;
    }

    .event-card-body {
        font-size: 13px !important;
    }
}

/* ============================================
   CALENDAR MOBILE
   ============================================ */
@media (max-width: 767px) {
    .calendar-container {
        padding: 10px;
        overflow-x: auto;
    }

    .calendar-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .calendar-header-title {
        font-size: 18px !important;
        text-align: center;
    }

    .calendar-nav {
        width: 100%;
        justify-content: space-between;
    }

    .calendar-nav-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }

    .calendar-grid {
        min-width: 100%;
        font-size: 12px;
    }

    .calendar-day-header {
        padding: 8px 4px !important;
        font-size: 11px !important;
    }

    .calendar-day {
        min-height: 60px !important;
        padding: 4px !important;
    }

    .calendar-day-number {
        font-size: 12px !important;
    }

    .calendar-event {
        font-size: 10px !important;
        padding: 2px 4px !important;
        margin-bottom: 2px !important;
    }

    .calendar-event i {
        display: none; /* Cache les icones pour gagner de la place */
    }
}

/* ============================================
   NEWS LIST MOBILE
   ============================================ */
@media (max-width: 767px) {
    .retro-news-container {
        gap: 15px !important;
    }

    .retro-news-item {
        padding: 15px !important;
    }

    .retro-news-title {
        font-size: 18px !important;
        margin-bottom: 8px !important;
    }

    .retro-news-meta {
        font-size: 11px !important;
        flex-direction: column;
        gap: 4px;
    }

    .retro-news-body {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }

    .retro-news-link {
        font-size: 13px !important;
        padding: 8px 16px !important;
    }
}

/* ============================================
   BUTTONS MOBILE
   ============================================ */
@media (max-width: 767px) {
    .retro-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .retro-btn-lg {
        padding: 15px 30px !important;
        font-size: 18px !important;
    }

    .retro-btn-sm {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Boutons en pleine largeur sur mobile */
    .mobile-full-width {
        width: 100%;
        display: block;
        text-align: center;
    }
}

/* ============================================
   FORMS MOBILE
   ============================================ */
@media (max-width: 767px) {
    .generic-form table {
        display: block;
        overflow-x: auto;
    }

    .generic-form th,
    .generic-form td {
        display: block;
        width: 100% !important;
        padding: 8px !important;
    }

    .generic-form th {
        background: var(--color-bg-alt);
        font-weight: 600;
        border-bottom: none;
    }

    .generic-form td {
        border-bottom: 1px solid var(--color-border);
        margin-bottom: 15px;
    }

    .generic-form input[type="text"],
    .generic-form input[type="email"],
    .generic-form input[type="password"],
    .generic-form textarea,
    .generic-form select {
        width: 100%;
        font-size: 16px; /* Evite le zoom sur iOS */
    }
}

/* ============================================
   TABLES MOBILE
   ============================================ */
@media (max-width: 767px) {
    .retro-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
    }

    .retro-table {
        min-width: 500px;
        font-size: 12px;
    }

    .retro-table th,
    .retro-table td {
        padding: 8px 6px;
    }

    /* Pagination mobile */
    .pages {
        flex-wrap: wrap;
        gap: 5px;
        justify-content: center;
    }

    .pages a,
    .pages span {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 32px;
    }
}

/* ============================================
   UTILITY CLASSES MOBILE
   ============================================ */
@media (max-width: 767px) {
    .hide-mobile {
        display: none !important;
    }

    .show-mobile {
        display: block !important;
    }

    /* Espacement reduit sur mobile */
    .mobile-spacing-sm {
        margin-bottom: 10px !important;
    }

    .mobile-spacing-md {
        margin-bottom: 15px !important;
    }

    .mobile-spacing-lg {
        margin-bottom: 20px !important;
    }

    /* Texte centre sur mobile */
    .mobile-text-center {
        text-align: center !important;
    }

    /* Padding reduit sur mobile */
    .mobile-padding-sm {
        padding: 10px !important;
    }
}

/* ============================================
   CONTAINER MOBILE
   ============================================ */
@media (max-width: 767px) {
    #main {
        padding: 10px;
    }

    .container {
        padding: 0 10px;
    }

    /* Supprime les marges excessives */
    body {
        margin: 0;
        padding: 0;
    }
}

/* ============================================
   FOOTER MOBILE
   ============================================ */
@media (max-width: 767px) {
    .retro-footer {
        padding: 20px 15px;
        font-size: 12px;
        text-align: center;
    }

    .retro-footer-content {
        flex-direction: column;
        gap: 15px;
    }

    .retro-footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

