#plans-table {
    width: 100%;
    border-collapse: collapse;
}

#plans-table th, 
#plans-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}

.energy-plans-table {
    position: relative;
    overflow-x: visible; /* desktop default: no horizontal scrollbar */
}

img.company-logo {
    border-radius: 0px !important;
}

.table-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 8px 12px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    opacity: 0.95;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.table-scroll-btn.left {
    left: 8px;
}

.table-scroll-btn.right {
    right: 8px;
}

.table-scroll-btn:hover {
    background: rgba(0,0,0,0.8);
}

.table-scroll-btn:focus {
    outline: 2px solid #fff;
}

/* Mobile Pagination Styles */
.mobile-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    margin-bottom: 15px;
}

.pagination-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.pagination-btn:hover {
    background: #005a87;
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

/* Force table to be scrollable on tablet screens */
@media (min-width: 769px) and (max-width: 1024px) {
    .energy-plans-table {
        overflow-x: visible;
        -webkit-overflow-scrolling: touch;
    }
    
    #plans-table {
        min-width: 720px;
    }
    
    .table-scroll-btn {
        display: flex;
    }
}

/* MOBILE STYLES */
@media screen and (max-width: 768px) {
    /* Hide table scroll arrows on mobile - we use pagination instead */
    .table-scroll-btn {
        display: none !important;
    }
    
    /* Mobile pagination is handled by JS - show/hide based on content */
    .mobile-pagination {
        display: flex;
    }
    
    /* Table transformation for mobile cards */
    #plans-table thead {
        display: none;
    }
    
    #plans-table, 
    #plans-table tbody, 
    #plans-table tr, 
    #plans-table td {
        display: block;
        width: 100%;
    }
    
    #plans-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 10px;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    #plans-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border: none;
        border-bottom: 1px solid #eee;
        padding-top: 10px;
        padding-bottom: 10px;
    }
    
    #plans-table td:last-child {
        border-bottom: none;
    }
    
    #plans-table td::before {
        position: absolute;
        left: 10px;
        width: 45%;
        font-weight: bold;
        text-align: left;
        white-space: nowrap;
        color: #333;
    }
    
    #plans-table td:nth-of-type(1)::before {
        content: "Selskab";
    }
    
    #plans-table td:nth-of-type(2)::before {
        content: "Produkt";
    }
    
    #plans-table td:nth-of-type(3)::before {
        content: "Type";
    }
    
    #plans-table td:nth-of-type(4)::before {
        content: "Spottillæg/Fast pris (kr/kWh)";
    }
    
    #plans-table td:nth-of-type(5)::before {
        content: "Abonnement (kr/md)";
    }
    
    #plans-table td:nth-of-type(6)::before {
        content: "Estimerede pris (kr/kWh)";
    }
    
    #plans-table td:nth-of-type(7)::before {
        content: "Månedlig pris (kr)";
    }
    
    /* Elg highlight styling for mobile */
    .elg-highlight {
        background-color: #DCEDD7 !important;
        color: #1F5135 !important;
        border-color: #1F5135 !important;
    }
    
    /* Responsive pagination buttons on mobile */
    .pagination-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-width: 70px;
    }
    
    .pagination-info {
        font-size: 13px;
        text-align: center;
    }
}
