/* 
 * TimeVox - Responsive Design
 * Version unifiée et corrigée pour le menu mobile
 */

/* === NAVIGATION MOBILE - SECTION PRINCIPALE === */
/* Configuration du menu mobile qui fonctionne sur TOUTES les pages */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Navigation mobile */
.mobile-nav {
    position: fixed;
    top: 80px; /* Hauteur du header */
    left: 0;
    right: 0;
    width: 100vw;
    background: rgba(26, 26, 26, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999;
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    
    /* MASQUÉ par défaut */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    
    /* Force l'affichage du bloc */
    display: block;
    pointer-events: none;
}

/* État actif du menu mobile */
.mobile-nav.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Liste du menu mobile */
.mobile-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.mobile-nav a {
    color: white;
    text-decoration: none;
    padding: 1rem;
    display: block;
    border-radius: 8px;
    transition: background 0.3s ease;
    font-weight: 500;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.mobile-nav a:hover,
.mobile-nav a.active {
    background: var(--accent-orange);
}

/* Hamburger icon */
.hamburger {
    width: 25px;
    height: 20px;
    position: relative;
    cursor: pointer;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: white;
    border-radius: 2px;
    position: absolute;
    transition: all 0.3s ease;
}

.hamburger span:nth-child(1) {
    top: 0;
}

.hamburger span:nth-child(2) {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger span:nth-child(3) {
    bottom: 0;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 50%;
    margin-top: -1.5px;
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg);
    bottom: 50%;
    margin-bottom: -1.5px;
}

/* === BREAKPOINTS RESPONSIFS === */

/* Large Desktop - 1400px+ */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* Desktop - max 1199px */
@media (max-width: 1199px) {
    .nav-container {
        padding: 0 1.5rem;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
    
    .nav-menu a {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .donate-btn {
        font-size: 0.9rem !important;
        padding: 0.6rem 1.2rem !important;
    }
    
    .hero-container {
        gap: 3rem;
    }
    
    .hero-title {
        font-size: 3rem;
    }
}

/* Tablette - max 991px */
@media (max-width: 991px) {
    .nav-menu {
        gap: 1rem;
    }
    
    .nav-menu a {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .logo-showcase {
        width: 300px;
        height: 300px;
    }
    
    .main-logo {
        width: 240px;
        height: 240px;
    }
    
    .logo-image {
        width: 180px;
        height: 180px;
    }
    
    .section {
        padding: 4rem 0;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .grid-4 {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Mobile et plus petit - max 767px */
@media (max-width: 767px) {
    /* ACTIVATION DU MENU MOBILE */
    .nav-container {
        padding: 0 1rem;
        height: 80px; /* Hauteur fixe importante */
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    /* MASQUER le menu desktop */
    .nav-menu {
        display: none !important;
    }
    
    /* AFFICHER le bouton mobile */
    .mobile-menu-toggle {
        display: block !important;
    }
    
    /* Ajustement de la position du menu mobile */
    .mobile-nav {
        top: 80px; /* Correspond à la hauteur du header */
    }
    
    /* Hero section mobile */
    .hero {
        padding-top: 80px; /* Éviter le chevauchement */
        min-height: 90vh;
    }
    
    .hero-install,
    .hero-blog,
    .hero-contact {
        padding: 160px 0 3rem 0; /* Plus d'espace en haut */
    }
    
    .hero-container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    /* Boutons et CTA */
    .cta-buttons {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    /* Logo mobile */
    .logo-showcase {
        width: 280px;
        height: 280px;
    }
    
    .main-logo {
        width: 220px;
        height: 220px;
    }
    
    .logo-image {
        width: 160px;
        height: 160px;
    }
    
    /* Layout général */
    .container {
        padding: 0 1rem;
    }
    
    .section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .section-subtitle {
        font-size: 1.1rem;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .card-icon {
        font-size: 2.5rem;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    /* Footer */
    .footer-content {
        gap: 1.5rem;
    }
    
    /* Installation spécifique mobile */
    .install-progress {
        gap: 1rem;
    }
    
    .step-number {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .requirements-grid {
        grid-template-columns: 1fr;
    }
    
    .step-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .step-info {
        text-align: center;
    }
    
    .imager-step {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .step-badge {
        align-self: center;
    }
    
    .config-table {
        padding: 1rem;
        overflow-x: auto;
    }
    
    .config-table table {
        font-size: 0.85rem;
    }
    
    .config-table th,
    .config-table td {
        padding: 0.7rem 0.5rem;
    }
    
    .method-tabs,
    .os-tabs {
        flex-direction: column;
    }
    
    .cost-breakdown {
        flex-direction: column;
        align-items: center;
    }
    
    .support-links {
        flex-direction: column;
        align-items: center;
    }
    
    .support-links .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .command-content pre {
        font-size: 0.8rem;
        word-break: break-all;
		white-space: normal;
    }
    
    .install-tasks {
        grid-template-columns: 1fr;
    }
    
    .troubleshooting-grid {
        grid-template-columns: 1fr;
    }
    
    /* Blog mobile */
    .blog-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .article-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .article-footer {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-read-more,
    .btn-github {
        text-align: center;
        width: 100%;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination-numbers {
        justify-content: center;
    }
    
    .newsletter-section {
        padding: 2rem 1rem;
    }
    
    .newsletter-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .newsletter-actions .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .update-info {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .update-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    /* Contact mobile */
    .contact-quick-links {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .quick-link {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-info-section {
        order: -1;
    }
    
    .contact-form-section,
    .contact-info-section {
        padding: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .support-options {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .support-option {
        padding: 1.5rem;
    }
    
    .share-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .share-btn {
        width: 120px;
        text-align: center;
    }
    
    .faq-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .faq-item {
        padding: 1.5rem;
    }
}

/* Mobile Portrait - max 575px */
@media (max-width: 575px) {
    .nav-container {
        padding: 0 0.5rem;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
    }
    
    .logo-showcase {
        width: 250px;
        height: 250px;
    }
    
    .main-logo {
        width: 200px;
        height: 200px;
    }
    
    .logo-image {
        width: 140px;
        height: 140px;
    }
    
    .container {
        padding: 0 0.5rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .card {
        padding: 1.2rem;
    }
    
    .card-icon {
        font-size: 2.2rem;
    }
    
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .code-block {
        padding: 1rem;
        font-size: 0.8rem;
        overflow-x: auto;
    }
    
    .copy-button {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
    
    /* Installation mobile portrait */
    .install-progress {
        flex-direction: column;
        align-items: center;
    }
    
    .command-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .step-badge {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .config-table table {
        font-size: 0.8rem;
    }
    
    .config-table th,
    .config-table td {
        padding: 0.5rem 0.3rem;
    }
    
    /* Blog mobile portrait */
    .blog-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .article-card {
        margin: 0 -0.5rem;
    }
    
    .article-content {
        padding: 0 1rem;
    }
    
    .article-footer {
        padding: 1rem;
    }
    
    .newsletter-section {
        padding: 1.5rem 1rem;
        margin: 0 -1rem;
    }
    
    .pagination-btn,
    .pagination-number,
    .pagination-current {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Contact mobile portrait */
    .hero-contact-content {
        padding: 0 1rem;
    }
    
    .contact-form-section,
    .contact-info-section {
        padding: 1.5rem;
        margin: 0 -0.5rem;
    }
    
    .support-section {
        padding: 2rem 1rem;
        margin: 0 -1rem;
    }
    
    .support-icon {
        font-size: 2.5rem;
    }
    
    .contact-method {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .contact-method-icon {
        align-self: center;
    }
}

/* Mode paysage mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding-top: 80px;
    }
    
    .hero-container {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .logo-showcase {
        width: 200px;
        height: 200px;
    }
    
    .main-logo {
        width: 160px;
        height: 160px;
    }
    
    .logo-image {
        width: 120px;
        height: 120px;
    }
    
    .section {
        padding: 1.5rem 0;
    }
}

/* Fermer le menu mobile lors du redimensionnement */
@media (min-width: 768px) {
    .mobile-nav {
        display: none !important;
    }
    
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* Améliorations tactiles pour appareils mobiles */
@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .main-logo:hover {
        transform: none;
    }
    
    /* Augmenter les zones tactiles */
    .btn {
        min-height: 48px;
    }
    
    .nav-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .mobile-nav a {
        min-height: 48px;
        display: flex;
        align-items: center;
    }
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
    .article-card,
    .contact-form-section,
    .contact-method,
    .support-info,
    .faq-item {
        background: #2d2d2d;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .article-title,
    .contact-method-content h4,
    .faq-item h3,
    .support-info h4 {
        color: #f0f0f0;
    }
    
    .article-changes,
    .article-fixes {
        background: #383838;
    }
    
    .newsletter-section {
        background: #2d2d2d;
        color: #e0e0e0;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        background: #383838;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        border-color: var(--accent-orange);
        background: #444;
    }
}

/* Accessibilité - réduction des mouvements */
@media (prefers-reduced-motion: reduce) {
    .contact-form,
    .contact-info-section,
    .faq-item:hover,
    .contact-method:hover,
    .support-option:hover,
    .card:hover,
    .btn:hover,
    .main-logo:hover {
        animation: none;
        transform: none;
        transition: none;
    }
    
    .mobile-nav.active {
        animation: none;
    }
    
    .hamburger span,
    .form-input,
    .form-select,
    .form-textarea,
    .quick-link,
    .contact-link,
    .share-btn {
        transition: none;
    }
}

/* Impression */
@media print {
    .header,
    .footer,
    .cta-buttons,
    .mobile-menu-toggle,
    .mobile-nav {
        display: none;
    }
    
    .hero {
        padding-top: 0;
        page-break-after: always;
    }
    
    .section {
        padding: 1rem 0;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .component-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ccc !important;
        background: white !important;
        box-shadow: none !important;
    }
    
    .component-icon {
        font-size: 1.5rem;
    }
    
    .pin-connections {
        border: 1px solid #ddd;
    }
    
    .pin-row:hover {
        background: none !important;
    }
}