/**
 * Стили для страниц с таблицами и взаимодействиями
 */

/* Таблицы DataGrid */
.dx-datagrid {
    font-family: 'Roboto', sans-serif;
}

.dx-gridbase-container {
    padding: 15px;
}

.dx-datagrid-container {
    padding: 15px;
    overflow-x: auto;
    box-sizing: border-box;
}

.dx-datagrid-headers {
    background-color: white;
    border-bottom: 1px solid #ddd;
}

.dx-datagrid-rowsview {
    overflow-x: auto;
}

.dx-datagrid-content {
    overflow-x: visible;
}

.dx-datagrid-headers .dx-datagrid-table th {
    font-weight: 400;
    color: #777;
    font-size: 14px;
    border: 1px solid #ddd;
}

.dx-datagrid-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.dx-datagrid-headers .dx-datagrid-table th, 
.dx-datagrid-rowsview .dx-datagrid-table td {
    border: 1px solid #ddd;
    padding: 8px 10px;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dx-row.dx-header-row {
    height: 36px;
}

.dx-row.dx-data-row {
    height: 40px;
}

.dx-row.dx-data-row:hover {
    background-color: #f5f9ff;
}

.dx-row.dx-data-row.dx-selection {
    background-color: rgba(33, 150, 243, 0.1);
}

[role="columnheader"] {
    font-size: 14px;
    font-weight: 400;
    color: #777;
    border: 1px solid #ddd;
    padding: 8px 10px;
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
    vertical-align: middle;
}

/* Чекбоксы */
.dx-checkbox {
    position: relative;
    display: inline-block;
}

.dx-checkbox-container {
    position: relative;
    height: 18px;
    width: 18px;
    border: 1px solid #ddd;
    border-radius: 2px;
    background-color: #fff;
}

.dx-checkbox-icon {
    position: absolute;
    width: 100%;
    height: 100%;
}

.dx-checkbox-checked .dx-checkbox-icon::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border-right: 2px solid #2196f3;
    border-bottom: 2px solid #2196f3;
    transform: rotate(45deg);
}

.dx-command-select {
    width: 40px;
    text-align: center;
}

.dx-checkbox.dx-select-checkbox {
    margin: 0 auto;
}

/* Панель поиска */
.dx-datagrid-header-panel {
    margin-bottom: 15px;
}

.dx-datagrid-search-panel {
    margin-left: 10px;
    width: calc(100% - 300px) !important;
}

.dx-texteditor-container {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.3s;
}

.dx-texteditor-container:hover {
    border-color: #bbb;
}

.dx-texteditor-container:focus-within {
    border-color: #2196f3;
    outline: none;
}

.dx-texteditor-input-container {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 6px 10px;
    gap: 8px;
}

.dx-icon-search {
    color: #999;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.dx-texteditor-input {
    border: none;
    outline: none;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    flex: 1;
    padding: 0;
    color: #333;
}

.dx-texteditor-input::placeholder {
    color: #999;
}

/* Пагинация */
.dx-pager {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dx-page-sizes {
    display: flex;
    gap: 5px;
}

.dx-page-size {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.dx-page-size.dx-selection {
    background-color: #f0f0f0;
    font-weight: 500;
}

.dx-pages {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 300px;
}

.dx-info {
    color: #666;
}

.dx-page-indexes {
    display: flex;
    gap: 5px;
}

.dx-page {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.dx-page.dx-selection {
    background-color: #f0f0f0;
    font-weight: 500;
}

/* Мобильный телефон */
.mobile-phone-container {
    position: fixed;
    top: 50%;
    right: 50px;
    transform: translate(0, -50%) scale(0);
    z-index: 1000;
    transition: transform 0.5s ease-in-out;
    pointer-events: none;
}

.mobile-phone-container.active {
    transform: translate(0, -50%) scale(1);
    pointer-events: auto;
}

.mobile-phone {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-phone img {
    max-height: 80vh;
    width: auto;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Кликабельные области на телефоне */
.reception-clickable-area {
    position: absolute;
    top: 110px;
    left: 35px;
    width: 210px;
    height: 50px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    z-index: 10;
    transition: top 0.3s ease, height 0.3s ease, background-color 0.3s ease, border-color 0.3s;
}

.reception-clickable-area.highlight {
    border-color: #2196f3;
    animation: borderPulse 1.5s infinite;
}

.postuplenie-clickable-area {
    position: absolute;
    top: 110px;
    left: 35px;
    width: 210px;
    height: 50px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    z-index: 10;
    transition: border-color 0.3s;
}

.podborzakaza-clickable-area {
    position: absolute;
    top: 210px;
    left: 35px;
    width: 210px;
    height: 50px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    z-index: 10;
    transition: border-color 0.3s;
}

.inventory-clickable-area {
    position: absolute;
    top: 160px;
    left: 35px;
    width: 210px;
    height: 50px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    z-index: 10;
    transition: border-color 0.3s;
}

.sborshk-clickable-area {
    position: absolute;
    top: 260px;
    left: 35px;
    width: 210px;
    height: 50px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    z-index: 10;
    transition: border-color 0.3s;
}

.revaluation-clickable-area {
    position: absolute;
    top: 410px;
    left: 35px;
    width: 210px;
    height: 50px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    z-index: 10;
    transition: border-color 0.3s;
}

.postuplenie-clickable-area.highlight,
.podborzakaza-clickable-area.highlight,
.inventory-clickable-area.highlight,
.sborshk-clickable-area.highlight,
.revaluation-clickable-area.highlight {
    border-color: #2196f3;
    animation: borderPulse 1.5s infinite;
}

/* Попапы */
.marking-popup {
    position: fixed;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s, visibility 0.5s, transform 0.5s;
    transform: translateX(20px);
    max-width: 350px;
}

.receipt-popup {
    position: fixed;
    z-index: 1100; /* Выше чем marking-popup, чтобы быть поверх */
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s, visibility 0.5s, transform 0.5s;
    transform: translateX(20px);
    max-width: 350px;
}

.marking-popup.active,
.receipt-popup.active {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
}

.marking-popup-content,
.receipt-popup-content {
    position: relative;
    background-color: #FFD7D7;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    min-width: 200px;
}

.marking-popup-text,
.receipt-popup-text {
    color: #333;
    font-size: 16px;
    line-height: 1.5;
}

/* Оверлей страницы */
.page-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 0, 0, 0.3);
    z-index: 999;
    display: none;
    pointer-events: none;
}

.page-overlay.active {
    display: block;
    animation: fadeInOut 0.5s ease-in-out;
}

/* Подсветка колонки */
#columnHighlight {
    position: absolute;
    display: none;
    border: 2px solid #993535;
    border-radius: 4px;
    pointer-events: none;
    z-index: 100;
    animation: highlightBorderPulse 1.5s infinite;
}

/* Попап успешного завершения */
.success-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.5s, visibility 0.5s;
}

.success-popup.active {
    visibility: visible;
    opacity: 1;
}

.success-popup-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.success-popup-text {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 20px;
    color: #555;
}

.success-popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.success-popup-button {
    padding: 12px 20px;
    background-color: #993535;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
    text-align: center;
    text-decoration: none;
}

.success-popup-button:hover {
    background-color: #7a2a2a;
    transform: translateY(-2px);
}

