/* =============================================================================
   BALANCE DAY AHEAD DK GRAPHS
   ============================================================================= */

.dashboard-container-balance-dk {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.5rem;
    max-width: none;
}

.graph-container-balance-dk {
    flex: 0 0 calc(50% - 0.5rem);
    min-width: 250px;
    background: linear-gradient(135deg, #161b22 0%, #21262d 100%);
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 0.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    position: relative; /* Added for button positioning */
}

/* Fullscreen button styling */
.fullscreen-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(33, 38, 45, 0.9);
    border: 1px solid #30363d;
    color: #c9d1d9;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.fullscreen-btn:hover {
    background: rgba(48, 54, 61, 0.95);
    border-color: #58a6ff;
    color: #58a6ff;
    transform: scale(1.05);
}

/* Fullscreen mode styling */
.graph-container-balance-dk.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    background: #0d1117;
    border-radius: 0;
    padding: 20px;
    flex: none;
    min-width: unset;
}

.graph-container-balance-dk.fullscreen canvas {
    height: calc(100vh - 40px) !important;
}

.graph-container-balance-dk.fullscreen .fullscreen-btn {
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    font-size: 16px;
}

/* Tables section styling */
.tables-section-balance-day-ahead-dk,
.tables-section-balance-dk {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    margin-top: 20px;
}

.table-row-balance-day-ahead-dk,
.table-row-balance-dk {
    width: 100%;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .graph-container-balance-dk {
        flex: 0 0 calc(33.333% - 0.5rem); 
    }
}

@media (max-width: 900px) {
    .graph-container-balance-dk {
        flex: 0 0 calc(50% - 0.5rem);
    }
}

@media (max-width: 600px) {
    .graph-container-balance-dk {
        flex: 0 0 100%;
    }
}

.graph-container-balance-dk{
    position: relative;
    width: 100%;
    height: 400px; 
}

/* Table Styles */
.available-flows-capacity-minus-tsf,
.available-flows-table-container {
    margin: 5px 0;
    padding: 20px;
    background: rgba(22, 27, 34, 0.8);
    border-radius: 8px;
    border: 1px solid #30363d;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #30363d;
}

.table-header h3 {
    color: #c9d1d9;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.table-timestamp {
    color: #8b949e;
    font-size: 12px;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
    position: relative;
    background: #161b22;
}

.available-flows-capacity-minus-tsf {
    width: 100%;
    border-collapse: collapse;
    color: #c9d1d9;
    font-size: 13px;
}

.available-flows-capacity-minus-tsf th{
    background: #21262d !important;
    color: #f0f6fc;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #30363d !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
    font-size: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.available-flows-capacity-minus-tsf th::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #21262d;
    z-index: -1;
}

.available-flows-capacity-minus-tsf td{
    padding: 10px 8px;
    border-bottom: 1px solid #21262d;
    font-size: 16px;
}

.table-row:hover {
    background: rgba(56, 139, 253, 0.1);
}

.table-row.surplus {
    border-left: 3px solid #238636;
}

.table-row.deficit {
    border-left: 3px solid #da3633;
}

/* Table container layout */
.table-container-balance-dk {
    display: flex;
    gap: 20px;
    width: 100%;
    margin-top: 20px;
}

.left-table-section {
    flex: 1;
    min-width: 60%;
}

.right-table-section {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.available-flows-capacity-minus-tsf,
.available-flows-table-container {
    background: linear-gradient(135deg, #161b22 0%, #21262d 100%);
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 15px;
}

/* Conditional coloring for Available Flows table */
.bg-red {
    background-image: linear-gradient(120deg, rgb(255, 115, 119), rgb(255, 166, 176)) !important;
    color: #000000 !important;
    font-weight: bold;
}

.bg-yellow {
    background-image: linear-gradient(120deg, rgb(253, 255, 102), rgb(255, 248, 153)) !important;
    color: #000000 !important;
    font-weight: bold;
}

.bg-green {
    background-image: linear-gradient(120deg, rgb(155, 233, 152), rgb(200, 242, 194)) !important;
    color: #000000 !important;
    font-weight: bold;
}

.spot-price-cell {
    background-image: linear-gradient(120deg, rgb(141, 175, 255), rgb(192, 216, 255)) !important;
    color: #000000 !important;
    font-weight: bold;
}

/* Table styling with improved sticky header */
.available-flows-table {
    width: 100%;
    border-collapse: collapse;
    color: #c9d1d9;
    font-size: 13px;
}

.available-flows-table thead.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.available-flows-table th {
    background: #21262d !important;
    color: #f0f6fc !important;
    font-weight: 600;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    padding: 12px 8px;
    text-align: left;
    border-bottom: 2px solid #30363d !important;
    font-size: 16px;
}

.available-flows-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #21262d;
    font-size: 16px;
}

.power-hour-cell {
    background: #161b22 !important;
    color: #c9d1d9 !important;
    font-weight: bold;
}

.table-error {
    color: #f85149;
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Responsive design */
@media (max-width: 1200px) {
    .table-container-balance-dk {
        flex-direction: column;
    }
    
    .left-table-section, .right-table-section {
        flex: none;
        width: 100%;
    }
}
