/* ===============================================
   RESPONSIVE UNIVERSAL STYLES - MAGICSIGN
   Styles responsive appliqués à toute l'application
   =============================================== */

/* ===============================================
   GLOBAL RESPONSIVE UTILITIES
   =============================================== */

/* Screen reader only content */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--dark-purple, #6c3484);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 4px;
    font-weight: 600;
}

.skip-link:focus {
    top: 6px;
}

/* ===============================================
   UNIVERSAL RESPONSIVE BREAKPOINTS
   =============================================== */

/* Container responsive */
@media (max-width: 1400px) {
    .container {
        max-width: 1200px;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 960px;
    }
}

@media (max-width: 992px) {
    .container {
        max-width: 720px;
    }
}

@media (max-width: 768px) {
    .container {
        max-width: 540px;
        padding: 0 20px;
    }
}

@media (max-width: 576px) {
    .container {
        max-width: 100%;
        padding: 0 15px;
    }
}

/* ===============================================
   RESPONSIVE TEXT SCALING
   =============================================== */

/* Base font size scaling */
@media (max-width: 1200px) {
    html {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    html {
        font-size: 13px;
    }
}

@media (max-width: 400px) {
    html {
        font-size: 12px;
    }
}

/* ===============================================
   RESPONSIVE SPACING
   =============================================== */

/* Responsive margins */
@media (max-width: 768px) {
    .main-container {
        padding-top: 10px;
    }
    
    [class*="section-"] {
        margin: 20px 0;
    }
    
    .row {
        margin: 0 -10px;
    }
    
    [class*="col-"] {
        padding: 0 10px;
    }
}

@media (max-width: 576px) {
    .main-container {
        padding-top: 5px;
    }
    
    [class*="section-"] {
        margin: 15px 0;
    }
    
    .row {
        margin: 0 -5px;
    }
    
    [class*="col-"] {
        padding: 0 5px;
    }
}

/* ===============================================
   RESPONSIVE IMAGES
   =============================================== */

/* Base responsive images */
img {
    max-width: 100%;
    height: auto;
}

/* Responsive image containers */
@media (max-width: 768px) {
    .img-responsive {
        width: 100%;
        height: auto;
    }
    
    [class*="image-container"] {
        overflow: hidden;
        border-radius: 12px;
    }
}

/* ===============================================
   RESPONSIVE BUTTONS
   =============================================== */

@media (max-width: 768px) {
    [class*="btn-"] {
        padding: 10px 20px;
        font-size: 0.9em;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    [class*="btn-"] i {
        font-size: 1.1em;
    }
}

@media (max-width: 576px) {
    [class*="btn-"] {
        padding: 8px 15px;
        font-size: 0.85em;
    }
    
    [class*="btn-"] span {
        margin-left: 6px;
    }
}

/* ===============================================
   RESPONSIVE FORMS
   =============================================== */

@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    select,
    textarea {
        padding: 12px 15px;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 8px;
        min-height: 44px;
    }
    
    label {
        font-size: 0.9em;
        margin-bottom: 6px;
    }
}

@media (max-width: 576px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    select,
    textarea {
        padding: 10px 12px;
        font-size: 15px;
    }
}

/* ===============================================
   RESPONSIVE NAVIGATION
   =============================================== */

@media (max-width: 991px) {
    .d-lg-flex {
        display: none !important;
    }
    
    .d-lg-block {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .d-lg-none {
        display: none !important;
    }
}

/* ===============================================
   RESPONSIVE UTILITIES
   =============================================== */

/* Hide elements on specific screen sizes */
@media (max-width: 576px) {
    .hidden-xs {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .hidden-sm {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .hidden-md {
        display: none !important;
    }
}

@media (max-width: 1200px) {
    .hidden-lg {
        display: none !important;
    }
}

/* Show only on specific screen sizes */
@media (min-width: 576px) {
    .visible-xs-only {
        display: none !important;
    }
}

@media (max-width: 575px) {
    .visible-xs-only {
        display: block !important;
    }
}

/* ===============================================
   TOUCH IMPROVEMENTS
   =============================================== */

@media (max-width: 768px) {
    /* Improve touch targets */
    a, button, [role="button"] {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Prevent text selection on buttons */
    button, [role="button"] {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }
    
    /* Better tap highlighting */
    a, button, [role="button"] {
        -webkit-tap-highlight-color: rgba(108, 52, 132, 0.2);
    }
}

/* ===============================================
   PERFORMANCE OPTIMIZATIONS
   =============================================== */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    * {
        border-width: 2px !important;
    }
    
    [class*="btn-"] {
        border: 2px solid currentColor !important;
    }
}

/* Print optimizations */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    [class*="btn-"],
    .mobile-menu-overlay,
    [class*="floating-"] {
        display: none !important;
    }
    
    a {
        text-decoration: underline !important;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid !important;
    }
}
