/* style.css */
/*noinspection CssUnknownTarget*/
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --background-color: #f5f5f5;
    --text-color: #333;
    --error-color: #e74c3c;
    --success-color: #27ae60;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    min-height: 100vh;
}

.menu-column {
    width: 250px;
    background-color: var(--primary-color);
    color: white;
    height: 100vh;
    transition: all 0.3s;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
}

.menu-column.minimized {
    width: 60px;
}

.menu-toggle {
    padding: 10px;
    text-align: right;
    cursor: pointer;
}

.menu-item {
    padding: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.menu-item:hover {
    background-color: var(--secondary-color);
}

.menu-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.menu-text {
    display: inline-block;
    transition: opacity 0.3s, width 0.3s;
    white-space: nowrap;
}

.menu-column.minimized .menu-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.truncate {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.truncate:hover::after {
    content: attr(title);
    position: absolute;
    left: 0;
    top: 100%;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 5px;
    border-radius: 3px;
    z-index: 1000;
    white-space: normal;
    word-wrap: break-word;
    max-width: 300px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.sort-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 5px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><path d="M3 4h6L6 0 3 4zm0 4h6l-3 4-3-4z" fill="%23333"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
    flex-shrink: 0;
}

.main-content-wrapper {
    margin-left: 250px;
    transition: margin-left 0.3s;
    padding: 20px;
}

.main-content-wrapper.menu-minimized {
    margin-left: 60px;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
}

h1, h2 {
    color: var(--primary-color);
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 20px;
}

h1 {
    font-size: 28px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

h2 {
    font-size: 24px;
    margin-top: 30px;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin-top: 20px;
    font-size: 14px;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    overflow: hidden;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: #333;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

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

tr:last-child td {
    border-bottom: none;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #e9ecef;
}

.profit-value, .roi-value {
    font-weight: bold;
}

.profit-positive, .roi-positive {
    color: #006400; /* темно-зеленый */
}

.profit-neutral, .roi-neutral {
    color: #444444; /* темно-серый */
}

.profit-negative, .roi-negative {
    color: #8B0000; /* темно-красный */
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card {
    width: 200px; /* или любой другой размер, который вам нравится */
    border-radius: 10px; /* скругленные края */
    border: 1px solid; /* граница по контуру */
    flex-basis: 150px;
}

.card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* для вертикального выравнивания */
    padding: 1px;
}

.card-text {
    font-size: 36px;
    font-weight: bold;
    text-align: center; /* для горизонтального выравнивания */
}

/* стили для карточек в зависимости от значения */
#profit-card, #roi-card {
    background-color: #f7f7f7; /* бледно серый фон по умолчанию */
    border-color: #ccc; /* граница по контуру серого цвета */
}

#profit-card.positive, #roi-card.positive {
    background-color: #c6efce; /* бледно зеленый фон */
    border-color: #3e8e41; /* граница по контуру зеленого цвета */
}

#profit-card.negative, #roi-card.negative {
    background-color: #ffc5c5; /* бледно розовый фон */
    border-color: #8B0000; /* граница по контуру красного цвета */
}

#profit-card.neutral, #roi-card.neutral {
    background-color: #f7f7f7; /* бледно серый фон */
    border-color: #ccc; /* граница по контуру серого цвета */
}

.table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
}

.table-container table {
    width: 100%;
    min-width: max-content;
}

@media (min-width: 2000px) {
    .table-container {
        overflow-x: visible;
    }

    .table-container table {
        width: 100%;
    }
}

@media (max-width: 1999px) {
    .table-container {
        overflow-x: auto;
    }

    .table-container table {
        width: max-content;
    }
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .table-container {
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .menu-column {
        width: 100%;
        height: auto;
        position: relative;
    }

    .menu-column.minimized {
        width: 100%;
    }

    .main-content-wrapper {
        margin-left: 0;
        padding: 10px;
    }

    .main-content-wrapper.menu-minimized {
        margin-left: 0;
    }

    .menu-toggle {
        display: none;
    }

    .menu-item {
        display: inline-block;
        width: 25%;
        text-align: center;
        padding: 10px 5px;
    }

    .menu-item i {
        margin-right: 0;
        display: block;
        margin-bottom: 5px;
    }

    .menu-text {
        font-size: 12px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px 10px;
    }

    .button-group button {
        width: 100%;
        margin-bottom: 10px;
    }

    .name-column {
        width: 40%;
        max-width: none;
    }

    .url-column {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .total-stats {
        flex-direction: column;
        align-items: flex-start;
        margin-top: 10px;
    }

    .total-profit, .total-roi {
        margin-top: 10px;
    }
}

input[type="text"], input[type="password"], input[type="number"] {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button {
    padding: 10px 15px;
    margin: 10px 5px 10px 0;
    border: none;
    border-radius: 4px;
    background-color: var(--primary-color);
    color: #ecf0f1;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
}

button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

button i {
    margin-right: 8px;
}

.error {
    color: var(--error-color);
    font-weight: 500;
    padding: 10px;
    background-color: #fadbd8;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success {
    color: var(--success-color);
    font-weight: 500;
    padding: 10px;
    background-color: #d4efdf;
    border-radius: 4px;
    margin-bottom: 20px;
}

.metric-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 20px;
}

.metric {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.label {
    font-weight: bold;
    margin-right: 10px;
}

.value {
    font-size: 24px;
    font-weight: bold;
    color: #337ab7; /* или любой другой цвет, который вам нравится */
}

.total-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 20px;
    font-size: 24px;
    font-weight: bold;
}

.total-profit, .total-roi {
    text-align: center;
}

#big-total-profit, #big-total-roi {
    font-size: 36px;
}

.checkbox-column {
    width: 30px;
    text-align: center;
}

.checkbox-column input[type="checkbox"] {
    accent-color: var(--primary-color);
}

.id-column {
    width: 30px;
}

.name-column {
    width: auto;
    min-width: 100px;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trackername-column {
    width: auto;
    min-width: 200px;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.url-column {
    width: 75%;
    word-break: break-all;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--primary-color);
}

.button-group {
    margin-bottom: 30px;
}

.auth-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-form {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.auth-form h1 {
    text-align: center;
    margin-bottom: 20px;
}

.auth-form button {
    width: 100%;
    justify-content: center;
}

.run-button {
    background-color: #27ae60;
    color: white;
}

.stop-button {
    background-color: #e74c3c;
    color: white;
}

.reload-button {
    background-color: #3498db;
    color: white;
}

.status-indicator {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
}

.status-indicator.draft {
    background-color: #f1f1f1;
    color: #333;
}

.status-indicator.moderation {
    background-color: white;
    color: #3498db;
    border: 2px solid #3498db;
}

.status-indicator.approved {
    background-color: #3498db;
    color: white;
}

.status-indicator.rejected {
    background-color: #e74c3c;
    color: white;
}

.status-indicator.working {
    background-color: #2ecc71;
    color: white;
}

.status-indicator.paused {
    background-color: white;
    color: #f39c12;
    border: 2px solid #f39c12;
}

.status-indicator.stopped {
    background-color: #f39c12;
    color: white;
}

.status-indicator.completed {
    background-color: #95a5a6;
    color: white;
}

.status-indicator.unknown {
    background-color: white;
    color: black;
    border: 1px solid black;
}

#api_response {
    margin-top: 20px;
}

#api_response .response-content {
    background-color: #f4f4f4;
    padding: 10px;
    border-radius: 5px;
}

#api_response pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

.response-content pre {
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.response-content h4 {
    margin-top: 20px;
    margin-bottom: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 17px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 17px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 13px;
    width: 13px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(13px);
}

.slider.round {
    border-radius: 17px;
}

.rate-input-container {
    display: flex;
    align-items: center;
}

.rate-input {
    margin-right: 10px;
    height: 32px;
    padding: 0 5px;
    box-sizing: border-box;
}

.button-wrapper {
    width: 32px;
    height: 32px;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apply-rate-button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 20%;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.3s, transform 0.3s;
    position: relative;
}

.apply-rate-button i {
    font-size: 16px;
    margin: 0;
}

.apply-rate-button:hover {
    background-color: #0056b3;
    transform: none; /* Это предотвратит перемещение кнопки */
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.pagination-info {
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    gap: 10px;
}

.pagination-controls a {
    text-decoration: none;
    color: #333;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.pagination-controls a:hover {
    background-color: #f0f0f0;
}

.pagination-controls a.disabled {
    color: #ccc;
    pointer-events: none;
}

.table-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.show-rows {
    display: flex;
    align-items: center;
}

.show-rows label {
    margin-right: 10px;
}

.show-rows select {
    padding: 5px;
}

.auto-bid-percent-column {
    width: 100px;
}

.auto-bid-percent-container {
    display: flex;
    align-items: center;
}

.auto-bid-percent-display {
    cursor: pointer;
}

.auto-bid-percent-input {
    width: 60px;
    margin-right: 5px;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

.auto-bid-percent-column {
    width: 100px;
}

.auto-bid-percent-container {
    display: flex;
    align-items: center;
}

.auto-bid-percent-display {
    cursor: pointer;
    padding: 5px;
    border: 1px solid transparent;
    border-radius: 3px;
    transition: border-color 0.3s;
}

.auto-bid-percent-display:hover {
    border-color: #ccc;
}

.auto-bid-percent-select {
    width: 70px;
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: #fff;
    font-size: 14px;
}

/* Стили для мобильных устройств */
@media (max-width: 768px) {
    .auto-bid-percent-select {
        width: 100%;
        font-size: 16px; /* Увеличиваем размер шрифта для удобства на мобильных */
        padding: 8px; /* Увеличиваем отступы для удобства нажатия */
    }
}

.actions {
    white-space: nowrap;
}
.move-btn {
    padding: 2px 5px;
    margin: 0 2px;
    cursor: pointer;
}
.move-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.delete-btn {
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.2em;
    padding: 5px;
}
.delete-btn:hover {
    color: red;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}
.modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.modal-buttons {
    margin-top: 20px;
}
.modal-buttons button {
    margin: 0 10px;
    padding: 5px 15px;
    cursor: pointer;
}
.confirm-btn {
    background-color: #ff4444;
    color: white;
    border: none;
    border-radius: 3px;
}
.cancel-btn {
    background-color: #666;
    color: white;
    border: none;
    border-radius: 3px;
}

/* Красный цвет для опасных GSB Status */
.danger {
    color: red;
    font-weight: bold;
}

/* Зеленый цвет для Low Risk Level */
.risk-low {
    background-color: #d4edda; /* Светло-зеленый фон */
    color: #008000; /* Темно-зеленый текст */
}

/* Темно-желтый цвет для Medium Risk Level */
.risk-medium {
    background-color: #fff3cd; /* Светло-желтый фон */
    color: #856404; /* Темно-желтый текст */
}
