@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&family=Rubik:ital,wght@0,300..900;1,300..900&family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');

:root {
    /*--main-tcd-color: #6486ab !important;*/
    /*--main-tcd-font: 'Roboto', sans-serif;*/
    /**/
    /*--main-tcd-color: #2196F3 !important;;;*/
    --main-tcd-color: #ad1e1e !important;
    --main-tcd-font: 'Rubik', sans-serif;
}

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.custom-modal-overlay.no-close {
    cursor: default;
}

.custom-modal-overlay.no-close .custom-modal {
    cursor: default;
}

.custom-modal {
    background: white;
    border-radius: 6px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow: hidden;
    transform: translateY(-50px) scale(0.8);
    opacity: 0;
    transition: all 0.4s ease;
    border: none !important;
}

.custom-modal-overlay.active .custom-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.custom-modal-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.custom-modal-title {
    margin: 0;
    font-size: 14px;
    color: #1f2937;
    font-family: var(--main-tcd-font);
}

.custom-modal-close {
    background: none;
    border: none;
    font-size: 21px;
    cursor: pointer;
    color: #9397a1;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
    font-weight: bold;
}

.custom-modal-close:hover {
    background-color: var(--main-tcd-color);
    color: white;
}

.custom-modal-body {
    padding: 24px;
    color: #222222;
    line-height: 1.6;
    max-height: 95vh;
    overflow-y: auto;
    font-size: 14px;
    font-family: var(--main-tcd-font);
    background: white;
}

.modal-isolated-content {
    font-family: var(--main-tcd-font);
}

.custom-modal-footer {
    padding: 20px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.custom-modal-btn {
    padding: 7px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    min-width: 90px;
    font-family: var(--main-tcd-font);
    text-transform: none !important;
}

.custom-modal-btn-primary {
    background-color: #0d6efd !important;
    color: white !important;
}

.custom-modal-btn-primary:hover {
    background-color: #0b5ed7 !important;
    transform: translateY(-2px);
}

.custom-modal-btn-secondary {
    background-color: #6b7280 !important;
    color: white !important;
}

.custom-modal-btn-secondary:hover {
    background-color: #4b5563 !important;
    transform: translateY(-2px);
}

/* Сбрасываем все возможные Bootstrap стили */
.custom-modal-overlay * {
    box-sizing: border-box !important;
    margin: 0 !important;
}

.custom-modal *:not(button) {
    background: transparent !important;
}

/* Пример кастомных стилей через ID */
#special-modal .custom-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#special-modal .custom-modal-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#special-modal .custom-modal-title {
    color: white;
}

#warning-modal .custom-modal {
    border-left: 6px solid #f59e0b;
    background: #fffbeb;
}

#warning-modal .custom-modal-header {
    background: #fef3c7;
    border-bottom: 2px solid #f59e0b;
}

#warning-modal .custom-modal-title {
    color: #92400e;
}

#large-modal .custom-modal {
    max-width: 800px;
}

#small-modal .custom-modal {
    max-width: 300px;
}

#dark-modal .custom-modal {
    background: #1f2937;
    color: white;
}

#dark-modal .custom-modal-header {
    background: #374151;
    border-bottom: 2px solid #4b5563;
}

#dark-modal .custom-modal-title {
    color: white;
}

#dark-modal .custom-modal-body {
    background: #1f2937;
    color: #d1d5db;
}

.loading-error {
    font-size: 14px;
    text-align: center;
    padding: 40px;
    color: #F44336;
}

.custom-modal-loadContent {
    text-align: center;
    padding: 40px;
    display: flex;
    justify-content: center;
}

/* Классы позиционирования */
.custom-modal-overlay.top-align {
    align-items: flex-start;
    padding-top: 20px;
}

.custom-modal-overlay.bottom-align {
    align-items: flex-end;
    padding-bottom: 20px;
}

.custom-modal-overlay.left-align {
    justify-content: flex-start;
    padding-left: 20px;
}

.custom-modal-overlay.right-align {
    justify-content: flex-end;
    padding-right: 20px;
}

.custom-modal-overlay.top-left-align {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px 0 0 20px;
}

.custom-modal-overlay.top-right-align {
    align-items: flex-start;
    justify-content: flex-end;
    padding: 20px 20px 0 0;
}

.custom-modal-overlay.bottom-left-align {
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0 0 20px 20px;
}

.custom-modal-overlay.bottom-right-align {
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 20px 20px 0;
}

/* Анимации для разных позиций */
.custom-modal-overlay.top-align .custom-modal {
    transform: translateY(-50px) scale(0.9);
}

.custom-modal-overlay.top-align.active .custom-modal {
    transform: translateY(0) scale(1);
}

.custom-modal-overlay.bottom-align .custom-modal {
    transform: translateY(50px) scale(0.9);
}

.custom-modal-overlay.bottom-align.active .custom-modal {
    transform: translateY(0) scale(1);
}

.custom-modal-overlay.left-align .custom-modal {
    transform: translateX(-50px) scale(0.9);
}

.custom-modal-overlay.left-align.active .custom-modal {
    transform: translateX(0) scale(1);
}

.custom-modal-overlay.right-align .custom-modal {
    transform: translateX(50px) scale(0.9);
}

.custom-modal-overlay.right-align.active .custom-modal {
    transform: translateX(0) scale(1);
}

.custom-modal-overlay.top-left-align .custom-modal {
    transform: translate(-50px, -50px) scale(0.9);
}

.custom-modal-overlay.top-left-align.active .custom-modal {
    transform: translate(0, 0) scale(1);
}

.custom-modal-overlay.top-right-align .custom-modal {
    transform: translate(50px, -50px) scale(0.9);
}

.custom-modal-overlay.top-right-align.active .custom-modal {
    transform: translate(0, 0) scale(1);
}

.custom-modal-overlay.bottom-left-align .custom-modal {
    transform: translate(-50px, 50px) scale(0.9);
}

.custom-modal-overlay.bottom-left-align.active .custom-modal {
    transform: translate(0, 0) scale(1);
}

.custom-modal-overlay.bottom-right-align .custom-modal {
    transform: translate(50px, 50px) scale(0.9);
}

.custom-modal-overlay.bottom-right-align.active .custom-modal {
    transform: translate(0, 0) scale(1);
}

/* Режим на весь экран */
.custom-modal-fullscreen {
    width: 99vw !important;
    height: 97vh !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
}

.custom-modal-fullscreen-overlay {
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.custom-modal-body {
    max-height: calc(90vh - 100px) !important;
}

.custom-modal-fullscreen .custom-modal-body {
    max-height: calc(97vh - 80px) !important;
}

/* Плавная анимация */
.custom-modal {
    transition: all 0.3s ease;
}


/* Кастомные стили для конкретных модальных окон через ID */
#tcd-large-modal .custom-modal {
    max-width: 1040px;
}

#tcd-large-modal .custom-modal-header, #tcd-large-modal .custom-modal-footer {
    padding: 10px 24px;
}

#tcd-large-modal .custom-modal-title {
    font-family: var(--main-tcd-font);
    font-size: 14px;
    font-weight: 400;
}

#user_message_specify_modification {
    display: none !important;
}

#searchImageInGoogleModal .custom-modal {
    max-width: 1040px;
}

#searchImageInGoogleModal .custom-modal-header, #searchImageInGoogleModal .custom-modal-footer {
    padding: 10px 24px;
}

#searchImageInGoogleModal .custom-modal-title {
    font-family: var(--main-tcd-font);
    font-size: 14px;
    font-weight: 400;
}
