/* ========================================
   MOBILE TEXT FIXES - BOOTSTRAP COMPATIBLE
   Dennis Gutjahr - Tierisch Tiergesundheit
   ======================================== */

/* === MOBILE TEXT OVERFLOW FIXES === */
@media (max-width: 767px) {
    /* Global text wrapping fixes */
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* Fix long words and URLs */
    p, div, span, h1, h2, h3, h4, h5, h6 {
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    
    /* Special handling for links */
    a {
        word-break: break-all;
        overflow-wrap: anywhere;
    }
    
    /* Container fixes */
    .container, .container-fluid {
        max-width: 100%;
        overflow-x: hidden;
    }
    
    /* Card text fixes */
    .card, .card-body {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Button text fixes */
    .btn {
        white-space: normal;
        word-wrap: break-word;
        text-align: center;
    }
    
    /* Form text fixes */
    .form-control, .form-label {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Table text fixes */
    .table, .table td, .table th {
        word-wrap: break-word;
        word-break: break-word;
    }
}

/* === BOOTSTRAP TEXT UTILITY CLASSES === */
.text-break {
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

.text-wrap {
    white-space: normal !important;
}

.text-nowrap {
    white-space: nowrap !important;
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === RESPONSIVE TEXT SIZING === */
@media (max-width: 575px) {
    .text-responsive {
        font-size: 0.875rem !important;
        line-height: 1.4 !important;
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .text-responsive {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
    }
}

/* === MOBILE PERFORMANCE OPTIMIZATIONS === */
@media (max-width: 767px) {
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
    
    body {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}
