/* FastBot Base Styles - Мобильно-ориентированный дизайн */

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Базовые настройки */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    position: relative;
    min-height: 100vh;
}

/* Фоновый логотип */
.background-logo {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100vw;
    background-image: url('../../Loginity/images/FastbotImage.jpg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.5;
    z-index: -1;
    pointer-events: none;
}

/* Основная обертка контента */
.main-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 10px;
}

/* Контейнеры */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

.container-fluid {
    width: 100%;
    padding: 0 15px;
}

/* Сетка - мобильно-первый подход */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    flex: 1;
    padding: 0 10px;
    margin-bottom: 15px;
}

/* На мобильных - всегда полная ширина */
.col-12,
.col-mobile-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 10px;
}

/* На планшетах и выше */
@media (min-width: 768px) {
    .container {
        max-width: 1200px;
        padding: 0 20px;
    }
    
    .row {
        margin: 0 -15px;
    }
    
    .col {
        padding: 0 15px;
    }
    
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
    .col-lg-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
    .col-lg-8 { flex: 0 0 66.666%; max-width: 66.666%; }
}

/* Отступы */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.me-1 { margin-right: 8px; }
.me-2 { margin-right: 16px; }

.py-3 { padding: 24px 0; }
.py-4 { padding: 32px 0; }

/* Заголовки - крупные для мобильных */
h1, .h1 { 
    font-size: 28px; 
    font-weight: 700; 
    margin-bottom: 16px;
    color: #007bff;
}

h2, .h2 { 
    font-size: 24px; 
    font-weight: 600; 
    margin-bottom: 12px;
}

h3, .h3 { 
    font-size: 20px; 
    font-weight: 600; 
    margin-bottom: 10px;
}

h4, .h4 { 
    font-size: 18px; 
    font-weight: 600; 
    margin-bottom: 8px;
}

/* Кнопки - большие для мобильных */
.btn {
    display: inline-block;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px; /* Минимум для удобного тапа */
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-color: #007bff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border-color: #28a745;
}

.btn-outline-primary {
    background: transparent;
    color: #007bff;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    background: #007bff;
    color: white;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 14px;
    min-height: 40px;
}

.btn-lg {
    padding: 16px 24px;
    font-size: 18px;
    min-height: 52px;
}

/* На мобильных кнопки на всю ширину если нужно */
.btn-mobile-full {
    width: 100%;
    margin-bottom: 12px;
}

@media (max-width: 767px) {
    .btn-mobile-full {
        width: 100% !important;
        margin-bottom: 12px;
    }
}

/* Карточки - оптимизированы для мобильных */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 16px 20px;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
}

.card-text {
    color: #6c757d;
    margin-bottom: 16px;
    line-height: 1.6;
}

/* Формы - удобные для мобильных */
.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px; /* Предотвращает зум на iOS */
    line-height: 1.5;
    color: #495057;
    background: white;
    border: 2px solid #ced4da;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    background: white;
    border: 2px solid #ced4da;
    border-radius: 8px;
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Бейджи */
.badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.badge-primary { background: #007bff; color: white; }
.badge-success { background: #28a745; color: white; }
.badge-warning { background: #ffc107; color: #212529; }
.badge-secondary { background: #6c757d; color: white; }

/* Промо-бейдж особенный */
.promo-badge {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    display: inline-block;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

/* Алерты */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: #28a745;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: #17a2b8;
}

/* Утилиты */
.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }

.text-center { text-align: center; }
.text-end { text-align: right; }

.text-muted { color: #6c757d; }
.text-primary { color: #007bff; }
.text-success { color: #28a745; }

.fw-bold { font-weight: 700; }

/* Работа с номерами телефонов */
.phone-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.phone-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* График работы - важная информация */
.working-hours {
    background: #e7f3ff;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #007bff;
    margin: 12px 0;
    font-size: 14px;
    font-weight: 500;
}

/* Языковой переключатель */
.language-switcher {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.language-switcher select {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: white;
    font-size: 12px;
}

/* Таблицы - адаптивные */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}

.table th,
.table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

/* Модальные окна - мобильно-дружелюбные */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    color: #000;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 32px 0;
}

.page-item {
    display: block;
}

.page-link {
    display: block;
    padding: 10px 16px;
    color: #007bff;
    text-decoration: none;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    min-width: 44px;
    text-align: center;
    font-weight: 500;
}

.page-link:hover {
    background: #e9ecef;
    border-color: #007bff;
}

.page-item.active .page-link {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Специальные стили для FastBot */
.fastbot-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 24px 0;
    margin-bottom: 24px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.partner-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.partner-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.partner-id {
    background: #f8f9fa;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Анимации загрузки */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Мобильные улучшения */
@media (max-width: 767px) {
    .main-wrapper {
        padding: 5px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .card-body {
        padding: 16px;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 12px;
    }
    
    .text-end {
        text-align: center;
    }
    
    h1, .h1 {
        font-size: 24px;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px 4px;
    }
}