/* Critical CSS - Optimized Bootstrap and Font Awesome styles */

/* Essential Bootstrap Grid System */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container { max-width: 540px; }
}

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

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

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

@media (min-width: 1400px) {
    .container { max-width: 1320px; }
}

/* Essential Bootstrap Grid */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -7.5px;
    margin-left: -7.5px;
}

.col-4, .col-6, .col-12, .col-md-6, .col-lg-8, .col-lg-5, .col-sm-3, .col-md-2 {
    position: relative;
    width: 100%;
    padding-right: 7.5px;
    padding-left: 7.5px;
}

.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 576px) {
    .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
}

@media (min-width: 768px) {
    .col-md-2 { flex: 0 0 16.666667%; max-width: 16.666667%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .text-md-end { text-align: right !important; }
}

@media (min-width: 992px) {
    .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
}

/* Essential Bootstrap Utilities */
.d-flex { display: flex !important; }
.d-none { display: none !important; }
.align-items-center { align-items: center !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-md-end { justify-content: flex-end !important; }
.text-center { text-align: center !important; }
.text-muted { color: #6c757d !important; }
.text-decoration-none { text-decoration: none !important; }
.gap-3 { gap: 1rem !important; }

/* Essential Bootstrap Spacing */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.ms-auto { margin-left: auto !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-5 { padding-left: 3rem !important; padding-right: 3rem !important; }

/* Essential Bootstrap Components */
.navbar {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Logo and brand area optimization */
.navbar-brand {
    max-width: 40% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin-right: 1rem !important;
}

.navbar-brand img {
    flex-shrink: 0 !important;
}

/* Mobile styles moved to mobile-critical.css */

.navbar-expand-lg .navbar-nav {
    flex-direction: row;
}

.navbar-nav {
    display: flex;
    padding-left: 0;
    margin: 0;
    list-style: none;
}

.nav-item {
    margin-right: 0.5rem;
}

.nav-link {
    display: block;
    padding: 0.5rem 1rem;
    color: #212529;
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

.navbar-brand {
    padding-top: 0.3125rem;
    padding-bottom: 0.3125rem;
    margin-right: 1rem;
    font-size: 1.25rem;
    white-space: nowrap;
}

.navbar-toggler {
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    transition: box-shadow 0.15s ease-in-out;
}

.navbar-toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    vertical-align: middle;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

.collapse:not(.show) {
    display: none;
}

@media (min-width: 992px) {
    .navbar-expand-lg .navbar-collapse {
        display: flex !important;
    }
    .navbar-expand-lg .navbar-toggler {
        display: none;
    }
}

/* Essential Bootstrap Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.375rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-primary {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.btn-outline-primary {
    color: #0d6efd;
    border-color: #0d6efd;
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    color: #fff;
    background-color: #5c636a;
    border-color: #565e64;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    border-radius: 0.5rem;
}

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

/* Essential Bootstrap Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    display: none;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 0.5rem;
    pointer-events: none;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    outline: 0;
}

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: calc(0.5rem - 1px);
    border-top-right-radius: calc(0.5rem - 1px);
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem;
    border-top: 1px solid #dee2e6;
    border-bottom-right-radius: calc(0.5rem - 1px);
    border-bottom-left-radius: calc(0.5rem - 1px);
}

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
}

.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em 0.25em;
    color: #000;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.375rem;
    opacity: 0.5;
}

.btn-close:hover {
    color: #000;
    text-decoration: none;
    opacity: 0.75;
}

/* Essential Bootstrap Backgrounds */
.bg-white { background-color: #fff !important; }
.bg-light { background-color: #f8f9fa !important; }

/* Essential Bootstrap Typography */
.small { font-size: 0.875em; }
.lead { font-size: 1.25rem; font-weight: 300; }
.display-4 { font-size: 2.5rem; font-weight: 300; line-height: 1.2; }
.display-5 { font-size: 3rem; font-weight: 300; line-height: 1.2; }
.fw-bold { font-weight: 700 !important; }
.text-primary { color: #0d6efd !important; }
.text-success { color: #198754 !important; }

/* Essential Bootstrap Shadows */
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; }

/* Essential Bootstrap Breadcrumb */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    list-style: none;
    background-color: #e9ecef;
    border-radius: 0.375rem;
}

.breadcrumb-item + .breadcrumb-item {
    padding-left: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    float: left;
    padding-right: 0.5rem;
    color: #6c757d;
    content: "/";
}

.breadcrumb-item.active {
    color: #6c757d;
}

/* Essential Bootstrap Footer */
footer {
    margin-top: auto;
}

/* Essential Bootstrap Grid Utilities */
.g-2 { --bs-gutter-x: 0.5rem; --bs-gutter-y: 0.5rem; }
.g-2 > * { padding-right: calc(var(--bs-gutter-x) * 0.5); padding-left: calc(var(--bs-gutter-x) * 0.5); margin-top: var(--bs-gutter-y); }

/* Essential Font Awesome Icons */
.fas, .fa {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

.fa-star::before { content: "★"; }
.fa-question-circle::before { content: "?"; }
.fa-envelope::before { content: "✉"; }
.fa-globe::before { content: "🌐"; }
.fa-info-circle::before { content: "ℹ"; }

/* Essential Custom Styles */
/* Accessibility Improvements for Better Contrast */
.bg-opacity-50 {
    background-color: rgba(13, 110, 253, 0.8) !important;
}

.analysis-item.bg-primary.bg-opacity-50 {
    background-color: rgba(13, 110, 253, 0.9) !important;
}

.analysis-item.bg-success.bg-opacity-50 {
    background-color: rgba(25, 135, 84, 0.9) !important;
}

.analysis-item.bg-warning.bg-opacity-50 {
    background-color: rgba(255, 193, 7, 0.9) !important;
}

.analysis-item.bg-info.bg-opacity-50 {
    background-color: rgba(13, 202, 240, 0.9) !important;
}

.analysis-item .text-primary {
    color: #0056b3 !important;
    font-weight: 700 !important;
}

.analysis-item .text-success {
    color: #146c43 !important;
    font-weight: 700 !important;
}

.analysis-item .text-warning {
    color: #b45309 !important;
    font-weight: 700 !important;
}

.analysis-item .text-muted {
    color: #495057 !important;
    font-weight: 500 !important;
}

.analysis-item .text-dark {
    color: #212529 !important;
    font-weight: 600 !important;
}

/* Improved Button Contrast */
.btn-primary {
    color: #ffffff !important;
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
    font-weight: 600 !important;
}

.btn-primary:hover {
    color: #ffffff !important;
    background-color: #004085 !important;
    border-color: #004085 !important;
}

.btn-outline-primary {
    color: #0056b3 !important;
    border-color: #0056b3 !important;
    font-weight: 600 !important;
}

.btn-outline-primary:hover {
    color: #ffffff !important;
    background-color: #0056b3 !important;
    border-color: #0056b3 !important;
}

.btn-outline-info {
    color: #055160 !important;
    border-color: #055160 !important;
    font-weight: 600 !important;
}

.btn-outline-info:hover {
    color: #ffffff !important;
    background-color: #055160 !important;
    border-color: #055160 !important;
}

/* Стили для номеров шагов в секции add-bot */
.step-number {
    background-color: #0d6efd !important;
    color: #FF6B35 !important;
    font-weight: 700 !important;
    min-width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
}

.nav-btn {
    min-width: 120px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
}

@media (min-width: 769px) {
    .nav-btn {
        min-width: 140px !important;
        height: 38px !important;
        font-size: 14px !important;
        padding: 6px 16px !important;
    }
}

.hero-btn {
    min-height: 48px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mobile styles moved to mobile-critical.css */
