/* Mining Pool Management specific CSS */

/* Dashboard Card Styling */
.dashboard-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--medium-gray);
    padding-bottom: 15px;
}

.dashboard-header h2 {
    margin: 0;
    font-size: 1.8rem;
}

.dashboard-actions {
    display: flex;
    gap: 10px;
}

/* Pool Selection */
.pool-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.pools-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.pool-card {
    background-color: var(--light-gray);
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.pool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.pool-card.active {
    border: 2px solid var(--accent-color);
}

.pool-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.pool-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-active {
    background-color: #e3fcef;
    color: #00a86b;
}

.status-inactive {
    background-color: #f5f5f5;
    color: #777;
}

.pool-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pool-stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.pool-card-actions {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-item {
    background-color: var(--light-gray);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.summary-item h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: var(--dark-gray);
}

.summary-item p {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Chart Containers */
.chart-container {
    width: 100%;
    height: 300px;
    position: relative;
    margin-bottom: 20px;
}

.chart-container.wide {
    grid-column: span 2;
}

.chart-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--dark-gray);
}

/* Tab Navigation */
.tabs-container {
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    overflow-x: auto;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--medium-gray);
}

.tab-btn {
    padding: 10px 20px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--dark-gray);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--accent-color);
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom: 3px solid var(--accent-color);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Secondary Tabs */
.tabs-secondary {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--medium-gray);
}

.tab-btn-secondary {
    padding: 8px 15px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--dark-gray);
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn-secondary:hover {
    color: var(--accent-color);
}

.tab-btn-secondary.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

.subtab-pane {
    display: none;
}

.subtab-pane.active {
    display: block;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background-color: var(--light-gray);
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-gray);
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--medium-gray);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background-color: #f9f9f9;
}

.data-table .action-buttons {
    display: flex;
    gap: 5px;
}

.data-table .btn-icon {
    padding: 5px 10px;
    font-size: 14px;
}

/* Search and Filter */
.search-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
    font-size: 14px;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
    font-size: 14px;
    min-width: 150px;
}

/* Rewards Section */
.reward-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--light-gray);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.reward-info {
    flex: 1;
}

.reward-info h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item .label {
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin-bottom: 5px;
}

.reward-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reward-history h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

/* Settings Grid */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section h3 {
    border-bottom: 1px solid var(--medium-gray);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
}

.address-list {
    background-color: var(--light-gray);
    border-radius: 5px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.address-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid var(--medium-gray);
}

.address-item:last-child {
    border-bottom: none;
}

.address {
    font-family: monospace;
    font-size: 14px;
    word-break: break-all;
}

.address-label {
    background-color: #e6e6e6;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
}

/* Analytics Filters */
.analytics-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
    background-color: var(--light-gray);
    padding: 15px;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-input {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-input label {
    font-size: 12px;
    color: var(--dark-gray);
}

.date-input input {
    padding: 8px;
    border: 1px solid var(--medium-gray);
    border-radius: 5px;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* Efficiency Metrics */
.efficiency-metrics h3 {
    margin-bottom: 20px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.metric-card {
    background-color: var(--light-gray);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.metric-label {
    color: var(--dark-gray);
    font-size: 0.9rem;
}

/* Mock Data Section */
.mock-description {
    margin-bottom: 20px;
}

.mock-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--medium-gray);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark-gray);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--medium-gray);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Responsive fixes */
@media (max-width: 992px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container.wide {
        grid-column: span 1;
    }
    
    .reward-status {
        flex-direction: column;
        gap: 20px;
    }
    
    .reward-actions {
        width: 100%;
        flex-direction: row;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .dashboard-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .search-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .analytics-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-range {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 576px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        text-align: center;
        padding: 10px 5px;
        font-size: 14px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
}

.modal.show {
    display: flex !important;
}


  /* Исправление стилей модального окна */
  #modal-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
  }
  
  #modal-container.show {
    display: flex !important;
  }
  
  #modal-container:not(.show) {
    display: none !important;
  }
  
  #modal-container .modal-content {
    background-color: #fff !important;
    border-radius: 5px !important;
    padding: 20px !important;
    max-width: 80% !important;
    max-height: 80% !important;
    overflow: auto !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3) !important;
    margin: 0 auto !important;
  }

/* Исправление модального окна */
#modal-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

#modal-container.show {
    display: flex !important;
}

#modal-container .modal-content {
    background-color: #fff;
    border-radius: 8px;
    padding: 0;
    max-width: 80%;
    max-height: 80%;
    overflow: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
}

/* Явно скрываем секцию Availabe Pools */
#mining-pools {
    display: none !important;
}

/* Стили для обработки длинных идентификаторов и улучшения таблицы */

/* Фиксированный макет таблицы для лучшего контроля ширины колонок */
.data-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

/* Горизонтальная прокрутка для таблицы на малых экранах */
.table-responsive {
    overflow-x: auto;
    max-width: 100%;
    margin-bottom: 1rem;
}

/* Обрезание длинного текста с многоточием */
.truncate-text {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    cursor: pointer; /* Показывает, что элемент интерактивный */
}

/* Установка ширины колонок */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
    width: 15%; /* Worker ID */
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
    width: 15%; /* Worker Name */
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
    width: 15%; /* Pool */
}

.data-table th:nth-child(4),
.data-table td:nth-child(4) {
    width: 10%; /* Hashrate */
}

.data-table th:nth-child(5),
.data-table td:nth-child(5) {
    width: 10%; /* Status */
}

.data-table th:nth-child(6),
.data-table td:nth-child(6) {
    width: 15%; /* Last Seen */
}

.data-table th:nth-child(7),
.data-table td:nth-child(7) {
    width: 10%; /* Rewards */
}

.data-table th:nth-child(8),
.data-table td:nth-child(8) {
    width: 10%; /* Actions */
}

/* Стили для подсказок (tooltips) */
.tooltip {
    position: relative;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: auto;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
    font-size: 12px;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Адаптивность для мобильных устройств */
@media screen and (max-width: 768px) {
    .data-table {
        table-layout: auto; /* Для лучшей адаптивности на малых экранах */
    }
    
    .data-table th,
    .data-table td {
        width: auto !important; /* Переопределение фиксированных ширин на малых экранах */
    }
    
    /* Скрываем некоторые колонки на мобильных устройствах */
    .data-table th:nth-child(6),
    .data-table td:nth-child(6),
    .data-table th:nth-child(7),
    .data-table td:nth-child(7) {
        display: none;
    }
}

/* Optimized worker table styles - add to the end of pool-styles.css */

/* Fixed table layout for better width control */
#workers-table {
  table-layout: fixed;
  width: 100%;
}

/* Optimized column widths for 7-column layout (no Name column) */
#workers-table th:nth-child(1),
#workers-table td:nth-child(1) {
  width: 22%; /* Worker ID */
}

#workers-table th:nth-child(2),
#workers-table td:nth-child(2) {
  width: 18%; /* Pool */
}

#workers-table th:nth-child(3),
#workers-table td:nth-child(3) {
  width: 12%; /* Hashrate */
}

#workers-table th:nth-child(4),
#workers-table td:nth-child(4) {
  width: 10%; /* Status */
}

#workers-table th:nth-child(5),
#workers-table td:nth-child(5) {
  width: 12%; /* First Seen */
}

#workers-table th:nth-child(6),
#workers-table td:nth-child(6) {
  width: 10%; /* Rewards */
}

#workers-table th:nth-child(7),
#workers-table td:nth-child(7) {
  width: 16%; /* Actions */
}

/* Ensure text truncation for long content */
#workers-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Optimize action buttons container */
.action-buttons {
  display: flex;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 2px;
}

/* Make action buttons more compact */
.action-buttons .btn {
  padding: 3px 6px;
  margin: 0;
  font-size: 0.85em;
}

/* Format dates in a compact way */
.date-compact {
  font-size: 0.9em;
}

/* Compact status badges */
.status-badge {
  padding: 2px 6px;
  font-size: 0.8em;
  display: inline-block;
}

/* Chart error message styling */
.chart-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.8);
  padding: 10px 15px;
  border-radius: 4px;
  color: #d32f2f;
  font-weight: 500;
}

.chart-container {
  position: relative;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    /* Hide top navigation elements */
    header .nav-menu {
        display: none !important;
    }
    
    .menu-toggle {
        display: none !important;
    }
    
    /* Simplify header - logo only */
    .header-container {
        justify-content: center !important;
        padding: 10px !important;
    }
    
    /* Hide authentication buttons in header */
    .auth-buttons {
        display: none !important;
    }
    
    /* Style bottom navigation */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        padding: 10px 0;
        border-top: 1px solid #e0e0e0;
    }
    
    .bottom-nav-container {
        display: flex;
        justify-content: space-around;
        align-items: center;
        width: 100%;
    }
    
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--dark-gray);
        font-size: 12px;
        font-weight: 500;
        padding: 5px;
        position: relative;
    }
    
    .bottom-nav-icon {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .bottom-nav-item.active {
        color: var(--accent-color);
    }
    
    .bottom-nav-item.active::after {
        content: '';
        position: absolute;
        width: 40%;
        height: 3px;
        background-color: var(--accent-color);
        bottom: -10px;
        left: 30%;
        border-radius: 2px;
    }
    
    /* Wallet indicator */
    .wallet-status-indicator {
        position: absolute;
        top: 2px;
        right: 2px;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        border: 1px solid white;
        box-shadow: 0 0 0 2px white;
        background-color: #f44336; /* Red by default */
    }
    
    .wallet-status-indicator.connected {
        background-color: #4caf50; /* Green when connected */
    }
    
    /* Wallet actions panel */
    .mobile-wallet-actions {
        display: none; /* Hidden by default */
        position: fixed;
        bottom: 70px; /* Above bottom navigation */
        left: 0;
        width: 100%;
        padding: 15px;
        background-color: #fff;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.2);
        z-index: 99;
        transition: transform 0.3s ease;
        transform: translateY(100%);
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
    }
    
    .mobile-wallet-actions.active {
        transform: translateY(0);
    }
    
    .mobile-wallet-actions.show {
        display: block;
    }
    
    .mobile-wallet-actions button {
        width: 100%;
        margin-bottom: 10px;
        padding: 12px;
        font-weight: 600;
    }
    
    .mobile-wallet-actions button:last-child {
        margin-bottom: 0;
    }
    
    /* Add padding to body for bottom nav */
    body {
        padding-bottom: 80px;
    }
    
    body.wallet-actions-open {
        padding-bottom: 200px;
    }
    
    /* Make section titles smaller on mobile */
    .section-title {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    /* Use single column layout on mobile */
    .wallet-grid {
        grid-template-columns: 1fr;
    }
}

/* Desktop only styles */
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
    
    .mobile-wallet-actions {
        display: none;
    }
}

/* Chart error message styling */
.chart-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(255, 255, 255, 0.8);
  padding: 10px 15px;
  border-radius: 4px;
  color: #d32f2f;
  font-weight: 500;
}

.chart-container {
  position: relative;
}

/* Улучшение отображения таблицы в pool details */
.modal-content .worker-details .table-responsive {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 15px;
}

.modal-content .data-table {
  width: 100%;
  min-width: 650px; /* Минимальная ширина таблицы для лучшего отображения */
  border-collapse: collapse;
}

.modal-content .data-table th,
.modal-content .data-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--medium-gray);
  word-break: break-word;
}

/* Стиль для длинных ID и имен, чтобы они не перекрывались */
.modal-content .data-table td:first-child,
.modal-content .data-table td:nth-child(2) {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* При наведении показывать полный текст */
.modal-content .data-table td:first-child:hover,
.modal-content .data-table td:nth-child(2):hover {
  overflow: visible;
  white-space: normal;
  word-break: break-word;
  background-color: rgba(247, 147, 26, 0.1);
  position: relative;
  z-index: 1;
}

/* Улучшение отображения на мобильных устройствах */
@media (max-width: 768px) {
  .modal-content .data-table {
    min-width: 500px;
  }
  
  .modal-content .modal-body {
    padding: 15px 10px;
  }
}