/* =================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   Универсальные стили для всех страниц
   ================================= */

/* Базовые настройки для мобилки */
@media (max-width: 768px) {
    
    /* === ОБЩИЕ СТИЛИ === */
    body {
        font-size: 14px;
        overflow-x: hidden;
    }

    h1 {
        font-size: 1.75rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    h4 {
        font-size: 1.1rem !important;
    }

    h5 {
        font-size: 1rem !important;
    }

    h6 {
        font-size: 0.9rem !important;
    }

    /* === КОНТЕЙНЕРЫ === */
    .container,
    .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .row {
        margin-left: -5px !important;
        margin-right: -5px !important;
    }

    .row > * {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    /* === КАРТОЧКИ === */
    .card {
        margin-bottom: 10px !important;
    }

    .card-body {
        padding: 15px !important;
    }

    .card-header {
        padding: 10px 15px !important;
    }

    /* === КНОПКИ === */
    .btn {
        padding: 10px 15px !important;
        font-size: 14px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .btn-lg {
        padding: 12px 20px !important;
        font-size: 16px !important;
    }

    .btn-sm {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    /* === ФОРМЫ === */
    .form-control {
        font-size: 16px !important; /* Предотвращает зум на iOS */
        padding: 10px !important;
    }

    .form-label {
        font-size: 14px !important;
        margin-bottom: 5px !important;
    }

    .input-group-text {
        font-size: 14px !important;
        padding: 10px !important;
    }

    /* === МОДАЛЬНЫЕ ОКНА === */
    .modal-dialog {
        margin: 10px !important;
    }

    .modal-content {
        border-radius: 10px;
    }

    .modal-header {
        padding: 15px !important;
    }

    .modal-body {
        padding: 15px !important;
    }

    .modal-footer {
        padding: 10px 15px !important;
    }

    /* === ТАБЛИЦЫ === */
    .table-responsive {
        border: 0;
        margin-bottom: 15px;
    }

    .table {
        font-size: 12px !important;
    }

    .table th,
    .table td {
        padding: 8px 5px !important;
        white-space: nowrap;
    }

    /* === НАВИГАЦИЯ === */
    .navbar {
        padding: 5px 10px !important;
    }

    .navbar-brand {
        font-size: 18px !important;
        padding: 5px 0 !important;
    }

    .nav-link {
        padding: 8px 12px !important;
        font-size: 14px !important;
    }

    .dropdown-menu {
        font-size: 14px !important;
    }

    .dropdown-item {
        padding: 8px 15px !important;
    }

    /* === БЕЙДЖИ === */
    .badge {
        font-size: 11px !important;
        padding: 4px 8px !important;
    }

    /* === АЛЕРТЫ === */
    .alert {
        padding: 10px 15px !important;
        font-size: 13px !important;
        margin-bottom: 10px !important;
    }

    /* === ИКОНКИ === */
    .fa-2x {
        font-size: 1.5em !important;
    }

    .fa-3x {
        font-size: 2em !important;
    }

    .fa-4x {
        font-size: 2.5em !important;
    }

    .fa-5x {
        font-size: 3em !important;
    }

    /* === ОТСТУПЫ === */
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .py-4 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .py-3 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }

    .px-5 {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    .px-4 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .mb-5 {
        margin-bottom: 2rem !important;
    }

    .mb-4 {
        margin-bottom: 1.5rem !important;
    }

    .mb-3 {
        margin-bottom: 1rem !important;
    }

    /* === ПРОГРЕСС БАРЫ === */
    .progress {
        height: 8px !important;
    }

    /* === DISPLAY UTILITIES === */
    .display-1,
    .display-2,
    .display-3,
    .display-4,
    .display-5,
    .display-6 {
        font-size: 2rem !important;
    }

    /* === ХЛЕБНЫЕ КРОШКИ === */
    .breadcrumb {
        font-size: 12px !important;
        padding: 8px 12px !important;
    }

    /* === ПАГИНАЦИЯ === */
    .pagination {
        font-size: 14px !important;
    }

    .page-link {
        padding: 6px 12px !important;
    }

    /* === СПИСОК ГРУПП === */
    .list-group-item {
        padding: 10px 15px !important;
        font-size: 14px !important;
    }

    /* === АККОРДЕОН === */
    .accordion-button {
        font-size: 14px !important;
        padding: 12px 15px !important;
    }

    .accordion-body {
        padding: 15px !important;
    }

    /* === СЕТКА (GRID) === */
    .col-md-6,
    .col-lg-4,
    .col-lg-3,
    .col-lg-6,
    .col-lg-8,
    .col-xl-3,
    .col-xl-4,
    .col-xl-6 {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* === СКРЫТИЕ НА МОБИЛКЕ === */
    .hide-mobile {
        display: none !important;
    }

    /* === ПОКАЗ ТОЛЬКО НА МОБИЛКЕ === */
    .show-mobile {
        display: block !important;
    }

    /* === ТЕКСТ === */
    .text-nowrap {
        white-space: normal !important;
    }

    /* === ФИКСЫ ДЛЯ OVERFLOW === */
    .overflow-auto {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    /* === STICKY ЭЛЕМЕНТЫ === */
    .sticky-top {
        position: relative !important;
    }

    /* === ФИКСЫ ДЛЯ FLEXBOX === */
    .d-flex {
        flex-wrap: wrap !important;
    }

    .flex-nowrap {
        flex-wrap: nowrap !important;
    }

    /* === CAROUSEL === */
    .carousel-caption {
        font-size: 12px !important;
        padding: 10px !important;
    }

    /* === ТУЛТИПЫ === */
    .tooltip-inner {
        font-size: 12px !important;
        padding: 6px 10px !important;
    }

    /* === ПОПОВ��РЫ === */
    .popover {
        font-size: 13px !important;
    }
}

/* =================================
   ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (< 576px)
   ================================= */
@media (max-width: 576px) {
    
    body {
        font-size: 13px;
    }

    h1 {
        font-size: 1.5rem !important;
    }

    h2 {
        font-size: 1.3rem !important;
    }

    h3 {
        font-size: 1.15rem !important;
    }

    .btn {
        font-size: 13px !important;
    }

    .btn-lg {
        font-size: 15px !important;
    }

    .container,
    .container-fluid {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .card-body {
        padding: 10px !important;
    }

    .table {
        font-size: 11px !important;
    }

    .table th,
    .table td {
        padding: 6px 3px !important;
    }
}

/* =================================
   ЛАНДШАФТНАЯ ОРИЕНТАЦИЯ
   ================================= */
@media (max-width: 768px) and (orientation: landscape) {
    
    .modal-dialog {
        max-height: 90vh;
        overflow-y: auto;
    }

    .navbar {
        padding: 3px 10px !important;
    }
}

/* =================================
   TOUCH УСТРОЙСТВА
   ================================= */
@media (hover: none) and (pointer: coarse) {
    
    /* Увеличиваем области нажатия */
    .btn,
    .nav-link,
    .dropdown-item,
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    /* Убираем hover эффекты */
    .btn:hover,
    .nav-link:hover {
        transform: none !important;
    }
}

/* =================================
   ПЕЧАТЬ
   ================================= */
@media print {
    .navbar,
    .btn,
    .hide-print {
        display: none !important;
    }

    body {
        font-size: 12pt;
    }

    .card {
        page-break-inside: avoid;
    }
}



